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

Issue 486853005: Fix idle connection pool issue in dart:io's HttpClient (Closed)

Created:
6 years, 4 months ago by kustermann
Modified:
6 years, 3 months ago
Reviewers:
Søren Gjesse
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Fix idle connection pool issue in dart:io's HttpClient So far if all connections in the connection pool of an http client were idle, the idle connections were closed after 100ms. This goes obviously against the idea of having a connection pool to avoid repeated reconnects. If a client makes a request, does some work for 110 ms and makes another request, the idle connection would be gone and it would reconnect. When a user is done with an HttpClient and called close() on it the HTTP client would in certain cases still sit around for another 100ms before closing all connections. For command line applications this might delay the time when the VM exists. This 100ms idle connection pool timeout was hard-coded and not changeable. There is still a idle timeout on a connection basis, defaulting to 15 seconds. This CL removes the mentioned 100ms timer and has 2 consequences: a) A connection stays in the pool for 15 seconds by default. b) The idle connections will be closed immediately if HttpClient.close() was called. Users who relied on the behaviour of a VM shutdown after 100ms without calling HttpClient.close() are broken and must be fixed. R=sgjesse@google.com Committed: https://code.google.com/p/dart/source/detail?r=39542

Patch Set 1 #

Patch Set 2 : #

Total comments: 2

Patch Set 3 : Fixed existing tests, removed bogus test, use async_helper for new test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+101 lines, -120 lines) Patch
M dart/sdk/lib/io/http_impl.dart View 1 8 chunks +22 lines, -32 lines 0 comments Download
A dart/tests/standalone/io/http_client_stays_alive_test.dart View 1 2 1 chunk +75 lines, -0 lines 0 comments Download
D dart/tests/standalone/io/http_client_timeout_test.dart View 1 2 1 chunk +0 lines, -85 lines 0 comments Download
M dart/tests/standalone/io/http_cross_process_test.dart View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M dart/tests/standalone/io/https_bad_certificate_client.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 5 (0 generated)
kustermann
6 years, 4 months ago (2014-08-25 17:32:01 UTC) #1
Søren Gjesse
This is the right thing to do, but it changes the semantics for users (direct ...
6 years, 4 months ago (2014-08-26 06:56:05 UTC) #2
kustermann
PTAL https://codereview.chromium.org/486853005/diff/20001/dart/tests/standalone/io/http_client_stays_alive_test.dart File dart/tests/standalone/io/http_client_stays_alive_test.dart (right): https://codereview.chromium.org/486853005/diff/20001/dart/tests/standalone/io/http_client_stays_alive_test.dart#newcode22 dart/tests/standalone/io/http_client_stays_alive_test.dart:22: if ((SECONDS - seconds).abs() > 2) { On ...
6 years, 3 months ago (2014-08-26 09:37:27 UTC) #3
Søren Gjesse
lgtm
6 years, 3 months ago (2014-08-26 09:43:11 UTC) #4
kustermann
6 years, 3 months ago (2014-08-26 09:46:55 UTC) #5
Message was sent while issue was closed.
Committed patchset #3 manually as 39542 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698