Skip to content

fix: reload rsmq scripts after the Redis script cache is flushed - #1156

Open
alexluong wants to merge 1 commit into
mainfrom
fix/rsmq-noscript
Open

alexluong wants to merge 1 commit into
mainfrom
fix/rsmq-noscript

Conversation

@alexluong

@alexluong alexluong commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

rsmq loads its Lua scripts once in NewRedisSMQ and then calls them only by hash with EVALSHA. A Redis or Dragonfly restart empties the server's script cache, so every receive, pop and visibility change fails with NOSCRIPT until Outpost restarts. For the retry scheduler: ~1 min of error backoff, then max consecutive errors reached, the retrymq-consumer worker stops, /healthz returns 503 and no retries run until the process restarts. Queued retries aren't lost; they wait.

This PR runs the scripts through go-redis Script.Run: EVALSHA, falling back to EVAL (which reloads the cache) on NOSCRIPT.

  1. RedisClient: EvalSha + ScriptLoad replaced by RunScript(*redis.Script, keys, args...), used by receive, pop and change visibility.
  2. No SCRIPT LOAD at startup; the first call loads each script.
  3. TestScriptCacheFlushed: SCRIPT FLUSH before each script call. Fails with NOSCRIPT on main.

🤖 Generated with Claude Code

This branch has not been deployed

No deployments
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.

2 participants