]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Fix messagepack cache decoding format string
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 19 Jan 2026 19:14:11 +0000 (19:14 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 19 Jan 2026 19:14:11 +0000 (19:14 +0000)
The UCL parser's parse_text() only accepts 'msgpack' as the format
string for messagepack parsing, while to_format() accepts both
'msgpack' and 'messagepack'. This mismatch caused cached data to
fail decoding and appear as cache misses.

Fixes LLM embedding cache never being read back despite being stored.

lualib/lua_cache.lua

index 6f731193b09badb1920d87cb34aeb1720fbda1e0..0c9a5502d76eca90653e87c149c08bd56d01b9b7 100644 (file)
@@ -160,7 +160,7 @@ local function create_cache_context(redis_params, opts, module_name)
 
     cache_context.decode = function(raw_data)
       local ucl_parser = ucl.parser()
-      local ok, ucl_err = ucl_parser:parse_text(raw_data, 'messagepack')
+      local ok, ucl_err = ucl_parser:parse_text(raw_data, 'msgpack')
       if not ok then
         lua_util.debugm(cache_context.N, rspamd_config, "failed to parse messagepack data: %s", ucl_err)
         return nil