You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version: redis 5.0.4, redis-py 3.3.6 Platform: Python 3.6.8 on Ubuntu 18.04 Description: When calling execute() on a pipeline (created with transaction=True), the EXEC is never sent if no commands are queued. While at first glance this makes sense as an optimization (why send an empty pipeline to the server?), in fact the EXEC might still have a purpose: to check if any of the WATCHed keys have since been modified.
Interesting, I had not really considered the use case of using multi/exec to just watch keys. If you want to change that check to something like if not stack and not self.watching: and then write a test that demonstrates that behavior works as expected I'll merge it in.
Version: redis 5.0.4, redis-py 3.3.6
Platform: Python 3.6.8 on Ubuntu 18.04
Description: When calling
execute()
on a pipeline (created withtransaction=True
), the EXEC is never sent if no commands are queued. While at first glance this makes sense as an optimization (why send an empty pipeline to the server?), in fact the EXEC might still have a purpose: to check if any of the WATCHed keys have since been modified.For example, under normal conditions:
However, if we don't run the
pipe.get('bar')
, the EXEC never gets sent:It's easy to see that this is caused by this short-circuit check on line 3673 of client.py:
https://github.com/andymccurdy/redis-py/blob/fa0b0392c86126cae1a264197dddab647fa37821/redis/client.py#L3670-L3674
Which, based on the git blame, looks like it was done based on the discussion here: #362
But it seems to me that if
pipe.watch()
has been called, we can't short circuit and must run the EXEC to see if the transaction succeeded or failed.The text was updated successfully, but these errors were encountered: