diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-07 23:45:30 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-07 23:45:30 +0000 |
commit | 7da01767d03ed6e6c5e8cfafc00b426dc77c4da5 (patch) | |
tree | 0d5af0ad821f6021d75cd1636cf1f21887d7fb54 /net/socket/client_socket_pool_base.h | |
parent | 9e64440a70e0a18ff5b6edcbf10652feb2954b39 (diff) | |
download | chromium_src-7da01767d03ed6e6c5e8cfafc00b426dc77c4da5.zip chromium_src-7da01767d03ed6e6c5e8cfafc00b426dc77c4da5.tar.gz chromium_src-7da01767d03ed6e6c5e8cfafc00b426dc77c4da5.tar.bz2 |
Fix IO thread hang on releasing a socket.
The problem was we assumed ProcessPendingRequest() would always make progress once the group's releasing socket went down to zero. However, in OnAvailableSocketSlot(), since the top stalled group might still have a releasing socket, it won't necessarily make progress. The algorithmic solution is to simply never do any socket slot processing in DoReleaseSocket() if there are any releasing sockets. This requires us to search for any stalled groups after releasing sockets gets back down to 0, so it requires the full group scan each time num_releasing_sockets goes back to 0. There is a performance hit here, but I think a linear search through 256~ groups in the worst case is ok.
TODO(willchan): evaluate the perf hit and consider adding a secondary data structure to improve the stalled group search.
BUG=42267
Review URL: http://codereview.chromium.org/2013009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46757 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/client_socket_pool_base.h')
-rw-r--r-- | net/socket/client_socket_pool_base.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/socket/client_socket_pool_base.h b/net/socket/client_socket_pool_base.h index 91289d8..89bdb78 100644 --- a/net/socket/client_socket_pool_base.h +++ b/net/socket/client_socket_pool_base.h @@ -408,6 +408,9 @@ class ClientSocketPoolBaseHelper // Number of connected sockets we handed out across all groups. int handed_out_socket_count_; + // Number of sockets being released. + int num_releasing_sockets_; + // The maximum total number of sockets. See ReachedMaxSocketsLimit. const int max_sockets_; |