DescriptionFix 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 #
Messages
Total messages: 5 (0 generated)
|