Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(572)

Unified Diff: net/socket/client_socket_pool_base.cc

Issue 9999030: Attempt to close idle connections in higher layer socket pools when a lower layer pool is stalled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/socket/client_socket_pool_base_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/client_socket_pool_base.cc
diff --git a/net/socket/client_socket_pool_base.cc b/net/socket/client_socket_pool_base.cc
index ab959cf06e2dde5c6c2d59f2f6526a53968a99a5..5bdd1f147e165f653c23892cfbc45d80c50d8aea 100644
--- a/net/socket/client_socket_pool_base.cc
+++ b/net/socket/client_socket_pool_base.cc
@@ -369,11 +369,21 @@ int ClientSocketPoolBaseHelper::RequestSocketInternal(
if (preconnecting && !closed)
return ERR_PRECONNECT_MAX_SOCKET_LIMIT;
} else {
- // We could check if we really have a stalled group here, but it requires
- // a scan of all groups, so just flip a flag here, and do the check later.
- request->net_log().AddEvent(
- NetLog::TYPE_SOCKET_POOL_STALLED_MAX_SOCKETS, NULL);
- return ERR_IO_PENDING;
+ do {
+ if (!CloseOneIdleConnectionInLayeredPool()) {
+ // We could check if we really have a stalled group here, but it
+ // requires a scan of all groups, so just flip a flag here, and do
willchan no longer on Chromium 2012/04/11 11:14:47 Stale comment? I don't think we flip a flag anymor
Ryan Hamilton 2012/04/16 20:51:54 Missed your comment earlier. Done.
+ // the check later.
+ request->net_log().AddEvent(
+ NetLog::TYPE_SOCKET_POOL_STALLED_MAX_SOCKETS, NULL);
+ return ERR_IO_PENDING;
+ }
+ } while (ReachedMaxSocketsLimit());
+
+ // It is possible that CloseOneIdleConnectionInLayeredPool() has deleted
+ // our Group (see http://crbug.com/109876), so look it up again
+ // to be safe.
+ group = GetOrCreateGroup(group_name);
}
}
« no previous file with comments | « no previous file | net/socket/client_socket_pool_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698