-
Notifications
You must be signed in to change notification settings - Fork 15
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
redis namespace not properly combined with abort and cancel keys #26
Comments
When I implemented it I expected for users to bring their own colons, as you can see in here. I guess it would be better for the library to give you a free one. Both the cases you provided should work with namespaces as the namespace is applied by the backend at the _encode_key function, but you are welcome to test it. |
Ah yes I see, thank you for pointing me these facts. So in that case it is free to add any separator like a column or not when defining the namespace. This is fine I think too. It just differs from other middleware like ResultMiddleware where the column separator seems to be hardcoded between the namespace and the (rest of the) key, see here. Now I have one additional question: I saw that the requests (e.g. abort) are identified by threads, see here and here. I guess this technic would not survive a reboot of the worker handling the actor since the thread would be restarted and get a new threading instance. |
The thread identifier is not stored in Redis, it's in process memory. If the worker reboot, it's going to rebuild this mapping with the new threads. In short, as a worker process messages, it keeps a mapping of
I guess it can make sense, consistency is good. PR are welcome. |
Actually, if I understand it correctly, calling
I guess this feature of "force-deleting" the dramatiq message after aborting timeout has been reached would be out of scope of the abort middleware right? As for the column suffix after the redis namespace, I'm finally not sure anymore it is needed to be changed. I guess that column is only some commonly seen convention but no standard rule, so maybe it should rather be un-harcoded in the dramatiq lib, I don't know... |
When
abort()
orcancel()
is called, a key is pushed on to redis. That key seems to be named:redis namespace + dramatiq message_id
but the namespace is not properly separated by a column (':') with the message_id, see here.For example if my redis namespace = "myapp" and the dramatiq message_id = "task123" then aborting that message will push a key "myappabort:task123" instead of "myapp:abort:task123" (notice the column just after the namespace)
Are the abort / cancel key names expected to be like that?
Also in the middleware, before processing the message, the abort / cancel key will be checked, see here.
Is the redis namespace taken into account here?
Does aborting / cancelling dramatiq message works when a custom redis namespace has been defined?
The text was updated successfully, but these errors were encountered: