Repository navigation
Fetch hash field TTLs in seconds in DefaultHashOperations - #3430
Closed
hunseonglee wants to merge 1 commit into
Closed
hunseonglee wants to merge 1 commit into
hunseonglee wants to merge 1 commit into
Conversation
getTimeToLive called the unit-aware hTtl variant, whose driver implementations already convert the server's seconds into the requested TimeUnit, but then labeled the returned values as seconds for Expirations, which converted them again. Requesting minutes for a 120-second TTL yielded 2 seconds instead of 2 minutes. Use the unit-less hTtl variant and let Expirations convert once, matching the reactive implementation. Closes spring-projects#3427 Signed-off-by: seonghun lee <harrisleesh@gmail.com>
mhalbritter
added a commit
that referenced
this pull request
Sep 7, 2026
mhalbritter
added a commit
that referenced
this pull request
Sep 7, 2026
mhalbritter
added a commit
that referenced
this pull request
Sep 7, 2026
Contributor
|
Thanks @harrisleesh, and congrats on your first contribution! This is merged and backported now. |
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.
Closes #3427
getTimeToLive(key, timeUnit, hashKeys)called the unit-awarehTtl(rawKey, timeUnit, rawHashKeys), whose driver implementations already convert the server's seconds into the requestedTimeUnit, but then labeled the returned values as seconds (Timeouts.of(TimeUnit.SECONDS, rawValues)), soExpirationsconverted them a second time. RequestingTimeUnit.MINUTESfor a field with a 120-second TTL yielded an expiration of 2 seconds (value()= 0) instead of 2 minutes.This change uses the unit-less
hTtlvariant and letsExpirationsconvert once, matchingDefaultReactiveHashOperations. A mock-based regression test added (fails onmainwithexpected: 2M but was: 2S, passes with the fix); the core unit test sweep passes (1409 tests).