Repository navigation
Conversation
`ReversedRedisListView` delegated `peek()`, `poll()` and `poll(long, TimeUnit)` to the tail of the view although `Deque` defines them as head operations. `poll(long, TimeUnit)` also replaced the given timeout with zero, which blocks on an empty list instead of returning after the timeout. `element()`, `pop()`, `remove()` and `drainTo(…)` build on these methods and now use the head of the view as well. Closes spring-projects#3458 Signed-off-by: Jialin Chen <cccll2019@gmail.com>
Contributor
|
Thanks @CCCLL ! Merged and backported. |
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 #3458
ReversedRedisListViewdelegatedpeek(),poll()andpoll(long, TimeUnit)to the tail of the view (peekLast()/pollLast()), althoughDequedefines them as equivalent topeekFirst()/pollFirst().poll(long, TimeUnit)also dropped its arguments and calledpollLast(0, TimeUnit.SECONDS), so a timed poll on an empty list sentBLPOP key 0and did not return after the timeout.This change delegates the three methods to
peekFirst(),pollFirst()andpollFirst(timeout, unit), in line with howtake()already delegates totakeFirst().element(),pop(),remove()anddrainTo(…)build on them and are fixed as well.Unit tests cover the delegation including the timeout, integration tests cover the behavior against Redis. All new tests fail on
mainand pass with the fix. Thesupport.collectionstests pass against Redis 8.6.2 with Lettuce and Jedis.