Skip to content
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

Fix JSONClient timeout so that requests actually abort on timeout #241

Open
cnrudd opened this issue Apr 20, 2022 · 0 comments
Open

Fix JSONClient timeout so that requests actually abort on timeout #241

cnrudd opened this issue Apr 20, 2022 · 0 comments

Comments

@cnrudd
Copy link
Member

cnrudd commented Apr 20, 2022

We noticed while looking at client logs, that requests that are setup with 30s or 1mn timeouts can sometimes not abort/hangup once the timeout is reached. We've seen requests last up to ~10mn.

As explained in this post
https://www.baeldung.com/httpclient-timeout
our current timeout configs do not hard abort a request.

The consequences are that under heavy load and slow response times from a remote host, our server is not freeing up request threads as fast as we thought, and performance is degrading.

To get real request aborts, we want to add a TimerTask with a method.abort() call to the method passed into https://github.com/xh/hoist-core/blob/develop/src/main/groovy/io/xh/hoist/http/JSONClient.groovy#L145

@amcclain amcclain changed the title fix http client timeout so that requests really do abort upon timeout Fix http client timeout so that requests really do abort upon timeout May 10, 2023
@amcclain amcclain changed the title Fix http client timeout so that requests really do abort upon timeout Fix JSONClient timeout so that requests actually abort on timeout May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant