Skip to content

Instantly share code, notes, and snippets.

@hispanic
Created November 26, 2015 12:41
Show Gist options
  • Save hispanic/14a1a404458af749906c to your computer and use it in GitHub Desktop.
Save hispanic/14a1a404458af749906c to your computer and use it in GitHub Desktop.
HttpClient Logging - Connection stale
Connection request: [route: {}->http://myhost:8080][total kept alive: 5; route allocated: 3 of 50; total allocated: 5 of 100]
Connection leased: [id: 56][route: {}->http://myhost:8080[total kept alive: 4; route allocated: 3 of 50; total allocated: 5 of 100]
Stale connection check
http-outgoing-56 << "end of stream"
Stale connection detected
http-outgoing-56: Close connection
Opening connection {}->http://myhost
Connecting to myhost:8080
@hispanic
Copy link
Author

By default, after leasing (re-using) an already-established connection from the pool, HttpClient will check the connection to see if it is “stale”. If so, the leased connection will be closed and a new connection opened to take its place in the pool. As a result, the allocation counts hold steady (not shown).

For more information, please see How to Read HttpClient Logging and Prevent Connection Leaks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment