Bug 17177 - Storage tasks are getting lost
Summary: Storage tasks are getting lost
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL: http://bugs.webkit.org/attachment.cgi...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2008-02-04 14:32 PST by Alexey Proskuryakov
Modified: 2008-02-12 11:38 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2008-02-04 14:32:01 PST
With WebCore SQL logging enabled, open <http://bugs.webkit.org/attachment.cgi?id=18455>. It runs without assertion failures now, but after a while, it just stops (it doesn't freeze Safari, but no more SQL requests are being served).
Comment 1 Alexey Proskuryakov 2008-02-06 01:55:10 PST
The database thread loop looks like this:

    while (!m_terminationRequested) {
        m_threadMutex.unlock();
        AutodrainedPool pool;

        LOG(StorageAPI, "Iteration of main loop for DatabaseThread %p", this);

        bool result;
        do {
            result = dispatchNextTaskIdentifier();
            if (m_terminationRequested)
                break;
        } while(result);

        if (m_terminationRequested)
            break;

        pool.cycle();
        m_threadMutex.lock();
        m_threadCondition.wait(m_threadMutex);
    }

It's pretty clear how the wakeup is lost - if a new task is dispatched after the inner loop has decided that it has nothing else to do, but before we're stopped on the condition, the condition is signaled in vain.
Comment 2 Alexey Proskuryakov 2008-02-07 05:19:56 PST
<rdar://problem/5729619>
Comment 3 Alexey Proskuryakov 2008-02-12 11:38:45 PST
Fixed in <http://trac.webkit.org/projects/webkit/changeset/30172>.