Conversation
SimpleClientHttpRequestFactory#setConnectTimeout(Duration), SimpleClientHttpRequestFactory#setReadTimeout(Duration) and ReactorClientHttpRequestFactory#setConnectTimeout(Duration) narrow Duration#toMillis() to an int with a plain cast. Above Integer.MAX_VALUE milliseconds (about 24.8 days) the value wraps around: Duration.ofDays(50) silently becomes a timeout of about 7 hours, while Duration.ofDays(25) becomes negative and is either ignored (SimpleClientHttpRequestFactory) or rejected as "Timeout must be a non-negative value" (ReactorClientHttpRequestFactory). This caps such values at Integer.MAX_VALUE instead. Signed-off-by: minwoo-3 <[email protected]>
This branch has not been deployed
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.
SimpleClientHttpRequestFactory#setConnectTimeout(Duration),SimpleClientHttpRequestFactory#setReadTimeout(Duration)andReactorClientHttpRequestFactory#setConnectTimeout(Duration)narrowDuration#toMillis()to anintwith a plain cast. AboveInteger.MAX_VALUEmilliseconds (about 24.8 days) the value wraps around:(int) toMillis()SimpleClientHttpRequestFactoryReactorClientHttpRequestFactoryofDays(24)ofDays(25)IllegalArgumentException: Timeout must be a non-negative valueofDays(50)ofDays(365)This caps such values at
Integer.MAX_VALUE, the longest timeout the underlyingint-based APIs can express. Values within theintrange are unaffected. It follows the same spirit as the overflow fix in gh-37208.