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

Issue 62181: Add a bound on the total number of active sockets in ClientSocketPool.... (Closed)

Created:
11 years, 8 months ago by eroman
Modified:
9 years, 6 months ago
Reviewers:
wtc
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Add a bound on the total number of active sockets in ClientSocketPool. BUG=9598

Patch Set 1 #

Patch Set 2 : fix handling of an edge case #

Total comments: 9

Patch Set 3 : do a gclient sync to update files #

Unified diffs Side-by-side diffs Delta from patch set Stats (+116 lines, -23 lines) Patch
M net/base/client_socket_pool.h View 1 2 4 chunks +49 lines, -2 lines 0 comments Download
M net/base/client_socket_pool.cc View 1 2 8 chunks +60 lines, -20 lines 0 comments Download
M net/http/http_network_session.h View 1 2 1 chunk +7 lines, -1 line 0 comments Download

Messages

Total messages: 2 (0 generated)
eroman
I am still figuring out the unit-test, and will ping when that is uploaded.
11 years, 8 months ago (2009-04-09 05:07:09 UTC) #1
wtc
11 years, 8 months ago (2009-04-10 22:08:22 UTC) #2
LGTM.

One change you made is that you're deleting empty groups
more eagerly than before.  Is this deliberate?  In one
place (http://codereview.chromium.org/62181/diff/2001/2003#newcode220)
you made this change by removing a return statement
near a refactoring site, so I am not sure if the return
statement was removed by mistake or intentionally.

http://codereview.chromium.org/62181/diff/2001/2003
File net/base/client_socket_pool.cc (right):

http://codereview.chromium.org/62181/diff/2001/2003#newcode115
Line 115: // Delete group if no longer needed.
Are you sure you want to delete an empty group here in
CancelRequest?  I think we should delete an empty group
only if it has been empty for a while, so that we don't
delete it and immediately recreate it.

http://codereview.chromium.org/62181/diff/2001/2003#newcode214
Line 214: // Check if there are any stalled groups left.
You can just let FindTopStalledGroup() do this.  After
FindTopStalledGroup() iterates over all the groups, if
there is <= 1 stalled group, it can reset
may_have_stalled_group_ to false before returning.
This will eliminate the second FindTopStalledGroup call.

http://codereview.chromium.org/62181/diff/2001/2003#newcode220
Line 220: StartPendingRequestForGroup(&group);
The original code has a return statement here.  Why is
it removed?

http://codereview.chromium.org/62181/diff/2001/2003#newcode243
Line 243: Group* group = &i->second;
Nit: define |group| as Group& (a reference) to be consistent
with existing code.

http://codereview.chromium.org/62181/diff/2001/2003#newcode247
Line 247: top_group->pending_requests.front().priority)) {
Nit: does this line need to be indented more than the
previous line?

http://codereview.chromium.org/62181/diff/2001/2004
File net/base/client_socket_pool.h (right):

http://codereview.chromium.org/62181/diff/2001/2004#newcode41
Line 41: // TODO(eroman): would be nice to define these in terms of "open"
sockets
Why can't we define these max socket limits in terms of
"open" sockets now?

http://codereview.chromium.org/62181/diff/2001/2004#newcode170
Line 170: // of when it happens with the following variable, and thus avoid
doing
Nit: be more direct, instead of "the following variable",
just say "may_have_stalled_group_".

http://codereview.chromium.org/62181/diff/2001/2004#newcode172
Line 172: bool may_have_stalled_group_;
Nit: move this data member down to be with the other
data members.

http://codereview.chromium.org/62181/diff/2001/2004#newcode196
Line 196: int max_sockets_;
Should we rename this max_total_sockets_ or
max_sockets_all_groups_?

Powered by Google App Engine
This is Rietveld 408576698