Bug 104976 - [WK2 NetworkProcess] Resource loads sometimes stall
Summary: [WK2 NetworkProcess] Resource loads sometimes stall
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-12-13 16:45 PST by Alexey Proskuryakov
Modified: 2012-12-14 13:26 PST (History)
1 user (show)

See Also:


Attachments
quick and dirty fix (1.27 KB, patch)
2012-12-13 16:52 PST, Alexey Proskuryakov
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2012-12-13 16:45:02 PST
I don't think that use of condition variables in BlockingResponseMap is correct.

There are multiple threads waiting, but only one signal(), so it resource identifier doesn't match, we're stuck forever. We should at least have a broadcast(), but ideally, we should have a design that doesn't wake up all threads.

<rdar://problem/12874785>
Comment 1 Alexey Proskuryakov 2012-12-13 16:52:17 PST
Created attachment 179377 [details]
quick and dirty fix
Comment 2 Anders Carlsson 2012-12-13 16:54:33 PST
Comment on attachment 179377 [details]
quick and dirty fix

View in context: https://bugs.webkit.org/attachment.cgi?id=179377&action=review

> Source/WebKit2/ChangeLog:12
> +        horibly inefficient, and has a race, but should improve behavior quite a bit.

horibly -> horribly.

> Source/WebKit2/Shared/BlockingResponseMap.h:57
> +        m_condition.broadcast();

Please add a FIXME here so we won't forget about it.
Comment 3 Alexey Proskuryakov 2012-12-13 17:30:26 PST
Landed in <http://trac.webkit.org/changeset/137689>. Will improve later.
Comment 4 Alexey Proskuryakov 2012-12-14 13:26:54 PST
Follow-up in http://trac.webkit.org/changeset/137766 - just applied the same change to the other map.