]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Fix] neural: retarget training vectors to best-known profile master
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 20 Apr 2026 21:02:54 +0000 (22:02 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 20 Apr 2026 21:02:54 +0000 (22:02 +0100)
commitdcc064ded1b2eb24e9130533253a5d61be92d8ca
tree582b84d10f266a92a9b99c4f63e4b1e1e1c6fe7e
parentb8d5c707d2e5e6d17198be8770964c827f3aaf87
[Fix] neural: retarget training vectors to best-known profile

Workers kept writing training data to the last-loaded ANN's redis key
(set.ann.redis_key) even when a newer, more specific profile was
already registered in the ZLIST.  If that new profile had no ANN data
yet (e.g. controller created a placeholder after a symbols change),
load_new_ann silently left set.ann untouched, so vectors kept piling
up under the old key while the controller waited for the new key's
spam/ham sets to fill — a deadlock visible as repeated "more specific
ann is available" log lines without any retrain ever happening.

Track the best-known profile in set.training_profile, updated on every
process_existing_ann tick whenever sel_elt is picked.  ann_push_task_result
now routes target_key and the vectors_len script call through
(set.training_profile or set.ann).redis_key, so training data lands on
the newest profile immediately.  set.ann is left alone so inference
keeps using the previously loaded ANN until a fresh one is trained.
src/plugins/lua/neural.lua