]> git.ipfire.org Git - thirdparty/rspamd.git/commit
fix(lua_redis): Improve Redis script loading 5464/head
authorJan Smutny <js@excello.cz>
Fri, 25 Apr 2025 09:36:49 +0000 (11:36 +0200)
committerJan Smutny <js@excello.cz>
Mon, 12 May 2025 08:41:31 +0000 (10:41 +0200)
commit0c3e1bb7b7072cb8975f695508cbbade26004bb7
tree1978f597eba3474a47387d18d661efa3687e9ccc
parent7a38f3c62d2373928ba6bc77f59e21d58dfd4896
fix(lua_redis): Improve Redis script loading

This change modifies how Rspamd handles Redis script loading across multiple
servers to improve resilience during server failures and restarts.

Previously, the system required ALL Redis servers to successfully load a script
before considering it ready for use. This caused modules to get stuck in a waiting
state when any Redis server was down, reporting errors like:
"redis script is not ready, waiting it to be loaded"
even when most servers were operational.

Key changes:
- Replace is_all_servers_ready() with is_any_server_ready() to allow operation
  when at least one server has successfully loaded the script
- Reset all servers to "unsent" status when NOSCRIPT errors are encountered to
  properly handle server restarts
- Ensure script loading is retried appropriately on reconnection

This fix allows Rspamd to continue operating when some Redis servers are temporarily
unavailable and to recover gracefully when servers rejoin the pool.
lualib/lua_redis.lua