#78 [svn] Scheduler dead-lock on portfolio

closed-fixed
9
2006-11-01
2006-09-25
No

It seems that the scheduler can get into a condition where two processes are dead-locked trying to access the portfolio. Once this happens, every scheduled job is unable to access the portfolio because it is locked. Possible work around; Do not lock when openning read-only. It would be best to do this and find the two jobs that are fighting over the portfolio data file.

Version: svn
Language: NOT USING NLS
Crypto: libmhash
TA-lib Version: < 0.2.0
Compression: enabled
SQL Support: enabled
OS: Linux 2.6.16-gentoo-r7
Bit Size: 32 bits
Server: Apache
User Agent: Opera/9.00 (X11; Linux i686; U; en)
Contact: mswilliamson@uwaterloo.ca

Discussion

  • Michael Williamson

    • labels: --> Scheduled Events
    • milestone: --> Version 0.2.x (Final)
    • priority: 5 --> 9
    • assigned_to: nobody --> mwilliamson
     
  • Michael Williamson

    Logged In: YES
    user_id=1281708

    I found a missing "close". This might release some locks
    that are causing this problem.

    Index: src/updatestoplossjob.cc

    --- src/updatestoplossjob.cc (revision 396)
    +++ src/updatestoplossjob.cc (working copy)
    @@ -98,6 +98,8 @@
    }
    da->read_next(rec);
    }
    +
    + db.close( da );
    }catch(...)
    {
    db.close( da );

     
  • Michael Williamson

    Logged In: YES
    user_id=1281708

    It seems that the news alerts are causing this problem? I checked all processes when the deadlock occurred and they were all
    trying to access the portfolio. I think there may be some sort of race condition here, when the portfolio is being refreshed
    while the alerts are running. Specifically the lock is at newsjob.cc:72.

     
  • Michael Williamson

    Logged In: YES
    user_id=1281708

    SVN commit #420: "Fixed: Database was not passing readonly flag to open file, possibly causing some
    lock contention issues."

    I think that this may be causing some of the problems, when the portfolio is locked by the user
    refreshing and then the news file is locked by the new reader writing.

     
  • Michael Williamson

    • status: open --> closed-fixed
     
  • Michael Williamson

    Logged In: YES
    user_id=1281708

    I found a bug in the fsdatabase class that was preventing read-only locking from being used. Now we shouldn't get a deadlock
    because both readers are obtaining shared locks on the portfolio.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks