-
Notifications
You must be signed in to change notification settings - Fork 703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default connection pool is poorly configured in ApacheHttpTransport. Oauth2 library #1060
Comments
I'm just posting this for other people that encounter this error and need a quick solution. Example of custom HTTP client implementation that can be used with google api. One mention: this is no optimized for high traffic - for high traffic Apache HC suggests to actually catch error and retry if you consider appropiate.
|
Just hit it, confirmed that it happens after a long time of not using the connection. |
When will this be fixed in this open source project? Any ETA ? |
As is, the default pool doesn't work well in a situation where the pool is infrequently used and causes NoHttpResponseExceptions.
This is because the pool defaults to an infinite keep alive time on the pooled connections when the server isn't providing a keep alive header. If they aren't used frequently, the connection on the Google server side will be closed. The connections aren't checked before re-use and you end up getting exception stacks like the one posted below.
These are totally avoidable by configuring the ConnectionKeepAliveStrategy on the pool OR providing a connection keep alive header value on the server responses. It seems like you should be able to provide a solid default keep alive configuration with knowledge of how long the server will actually keep connections open.
Stack trace below
The text was updated successfully, but these errors were encountered: