fix(http-client): use thread-safe connection pool#858
Merged
andrewazores merged 3 commits intocryostatio:mainfrom May 1, 2026
Merged
fix(http-client): use thread-safe connection pool#858andrewazores merged 3 commits intocryostatio:mainfrom
andrewazores merged 3 commits intocryostatio:mainfrom
Conversation
6c1ccb4 to
4246560
Compare
ebaron
approved these changes
May 1, 2026
andrewazores
added a commit
to andrewazores/cryostat-agent
that referenced
this pull request
May 1, 2026
* fix(http-client): use thread-safe connection pooling * fix(registration): reduce cooldown period
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #851
BasicHttpClientConnectionManager is NOT thread-safe and maintains only a single connection. It's designed for single-threaded use only, but the Agent uses a ScheduledExecutorService with 3 worker threads. Misuse of the connection manager by different threads leads to an IllegalStateException in the HTTP client the Agent uses to send requests to Cryostat.
This HTTP client failure results in the Agent entering a degraded cooldown state where it believes it's unable to register with the Cryostat server due to a server-side failure, which also results in it rejecting connection requests to its own WebServer. The cooldown period is too long and Cryostat repeatedly fails to ping the Agent because it's in cooldown for too long, resulting in Cryostat eventually pruning the plugin.
This patch does two things: