-
Notifications
You must be signed in to change notification settings - Fork 181
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
Read-Timeout not applied with Apache Http Components and no-SSL #861
Comments
As a temporary workaround for Spring Boot applications that need to support timeouts on HTTP Vault requests, adding this bean to your application will force the use of the JDK request factory rather than the Apache one:
|
Thanks for the report. We should fix that issue in |
I've stumbled upon the same problem and found this issue. I've submitted a PR |
Closes spring-projectsgh-861 Original pull request: spring-projectsgh-866
Configure ResponseTimeout for a Request, move off deprecated API by always configuring a PoolingHttpClientConnectionManager. See spring-projectsgh-861 Original pull request: spring-projectsgh-866
When using Apache Http Components with an http (non-SSL) Vault URI, the read-timeout option is not applied to the
HttpClientBuilder
. This results in the Apache-default of 3-minutes always being used, regardless of the settings provided via Spring Boot.I've created a trivial example project to demonstrate the issue here: https://github.com/p120ph37/spring-vault-test
I believe the fix would be to add
.setResponseTimeout(Timeout.ofMilliseconds(options.getReadTimeout().toMillis()))
here:spring-vault/spring-vault-core/src/main/java/org/springframework/vault/client/ClientHttpRequestFactoryFactory.java
Lines 329 to 333 in 5427861
I have prototyped this fix in the
FixedClientFactoryWrapper
in my test suite -- test that fix by uncommenting this line: https://github.com/p120ph37/spring-vault-test/blob/0ffcea4bc2d7401721f29b419c9596c91827023b/src/test/java/spring/vault/test/TimeoutTests.java#L43The text was updated successfully, but these errors were encountered: