-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pipelines seem to be false-y #994
Comments
I encountered the same surprising behavior. def create_session(session_id: str, ..., r: redis.Redis = None):
r = r or get_connection()
# Prepare/serialize the data...
# Write it to Redis... After the refactor I ran my test suite and noticed failures and saw a bunch of I expected a Pipeline instance to always be truthy since it inherits from Redis which is always truthy, but instead its truth value is based on if The documentation didn't mention anything about being able to run Pipeline is a a Redis client (inheritance) that has a command_stack (composition). So the fact that pipelines behave as the command_stack (the truthiness of an empty container is false), is unexpected. IMO, for now it's probably best to just document the current behavior, since people might be relaying on it in the wild. But long term (maybe next major version) I think the |
CC: @andymccurdy. |
Thanks for reporting this. This was unintended behavior. Pipelines will now always be |
The tasks are replicating because _remove_from_indices() removes only from 'unacked_index', but keeps task in 'unacked' - so effectively replicating the task. The issue is in pyredis pipe always being False as described here: redis/redis-py#994 and causing out of order execution of orders in multi block.
This is a non-blocking issue, since there's a clear work-around, but I just found it surprising:
Is there a particular reason
pipeline
objects should appear false-y? My inclination is that this doesn't pass the Principle of Least Surprise (but maybe I'm missing something).The text was updated successfully, but these errors were encountered: