mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-25 23:15:51 +03:00
[GH-ISSUE #951] [BUG/Discussion] Accessing undeclared keys in LUA scripts #2485
Labels
No labels
CLI
bug
designing
documentation
duplicate
enhancement
good first issue
good first issue
help wanted
idea
invalid
investigate
needs-more-info
performance
pr-welcome
pull-request
question
wontfix
work in progress
work in progress
work-around-available
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asynq#2485
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pior on GitHub (Oct 30, 2024).
Original GitHub issue: https://github.com/hibiken/asynq/issues/951
Originally assigned to: @hibiken on GitHub.
Describe the bug
I don't know whether this is a bug or not, but there may be an issue with the way this library uses LUA scripts:
https://redis.io/docs/latest/commands/eval/
However, many Asynq LUA scripts are doing exactly that, mostly for the task key:
github.com/hibiken/asynq@3dbda60333/internal/rdb/rdb.go (L227-L238)Stackoverflow says that specifying the keys is important when using Redis Cluster since it ensures that all keys are on the nodes where the lua script is running: https://stackoverflow.com/a/32091333
But this answer also mentions that the behavior is also undefined on a regular Redis 🤔.
There seems to be a few Github issues related to this: https://github.com/hibiken/asynq/issues/480 https://github.com/hibiken/asynq/issues/724 https://github.com/hibiken/asynq/issues/442
Discussion
I'm not sure whether there is a practical solution, but we should at least know and document this situation.
@kamikazechaser commented on GitHub (Oct 31, 2024):
Definitely an anti-pattern against redis recommendations. But in most cases these are dynamic keys being passed, not sure how we can go around these. I'll read up more on this.
@kamikazechaser commented on GitHub (Oct 31, 2024):
I think we should remove the line on the README and add a caveat about redis cluster compatibility until we confirm ALL scripts are redis cluster compatible (which isn't the case now).