Repository navigation
Improve internal handling of timeouts, make max timeout configurable - #244
Merged
Merged
Conversation
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Collaborator
Author
|
Note: This popped up because the LovPortal seems to have issues at the moment. Requests to it never return leading to the situation with Tomcat closing the client connection prematurely after 30 seconds before the API gateway gives up after its own 60 second timeout. |
jusa3
approved these changes
Oct 30, 2026
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.
This PR solves an issue with conflicting timeout settings on different layers of the application.
Spring Boot's internal Tomcat server, which handles all client requests to the API gateway, has its default request timeout set to 30 seconds, while the default API Gateway timeout for requests to connected providers is set to 60 seconds.
In case a federated query took longer than Tomcat's timeout, Tomcat would close the connection to the client prematurely, while the federated request would still be processed in the API gateway. The requested API gateway endpoint would then try to write its response to the client via the meanwhile closed socket, which resulted in an AsyncRequestNotUsableException.
This PR solves the issues by introducing the following changes:
timeoutrequest parameter, we now restrict the maximum value of thetimeoutrequest parameters to the API gateway's default timeout, making the API gateway default timeout the maximum timeout.application.propertiesfile via theapplication.timeout_ms.maxvalueproperty. The value can also be set from outside via the environment variableREQUEST_TIMEOUT_MS_MAXVALUE. If the variable does not exist the application falls back to a predefined value of 60 seconds (60,000 milliseconds).Internally, this brought about some internal API changes, especially in the ApiAccessor and the services that instantiate it. Some tests needed to be adapted to the changes.