Skip to content

Conversation

@sazzad16
Copy link
Contributor

Redis doesn't support WATCH within MULTI

Resolves #2030

@sazzad16 sazzad16 added this to the 4.0.0 milestone Jul 22, 2019
@sazzad16 sazzad16 requested a review from gkorland July 22, 2019 05:47
@gkorland
Copy link
Contributor

@sazzad16
LGTM!
But I would have add a test for pipeline.unwatch()

@sazzad16
Copy link
Contributor Author

@gkorland Sure thing! See 251b532 in #2032

Please consider that it's very difficult to have proper test for unwatch in pipeline mode.

@gkorland
Copy link
Contributor

You can test unwatch with two parallel connections or using JedisPool

@sazzad16
Copy link
Contributor Author

@gkorland I have added tests for WATCH and UNWATCH in #2086

https://github.com/xetorthio/jedis/blob/9de696236f59c4500f0b92c1b877d23b30e33e57/src/test/java/redis/clients/jedis/tests/PipeliningTest.java#L297-L346

so that these tests are valid for both 3.2+ and 4.0+ as this PR is for 4.0+ only.

@sazzad16
Copy link
Contributor Author

sazzad16 commented Nov 16, 2019

sazzad16 added a commit that referenced this pull request Nov 25, 2019
Tests for watch and unwatch

- Test: Redis supports UNWATCH within MULTI
- Tests for watch and unwatch while pipelining
- Fix test for brpoplpush

References: 
- #2033 (comment) 
- #2033 (comment) 
- #2033 (comment)
@sazzad16 sazzad16 removed the request for review from gkorland May 4, 2020 04:24
gkorland
gkorland previously approved these changes Jan 13, 2021
Copy link
Contributor

@yangbodong22011 yangbodong22011 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

yangbodong22011
yangbodong22011 previously approved these changes Feb 7, 2021
@sazzad16 sazzad16 deleted the watch-in-multi branch February 7, 2021 09:33
@sazzad16 sazzad16 restored the watch-in-multi branch March 31, 2021 07:03
@sazzad16 sazzad16 reopened this Mar 31, 2021
Copy link

@dengliming dengliming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sazzad16 sazzad16 merged commit b2e2cc5 into redis:master Apr 6, 2021
@sazzad16 sazzad16 deleted the watch-in-multi branch April 6, 2021 15:17
@sazzad16
Copy link
Contributor Author

More references:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ClassCastException when transaction.watch(...) is used

4 participants