diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-09-19 12:16:05 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-09-19 12:16:05 +0100 |
commit | 68cbb52701b0cb5a331959a3b645e375f4dc3749 (patch) | |
tree | a4151a354d43f68d0d856d014f2e802f8786abbc /src/libserver/symcache/symcache_c.cxx | |
parent | 19161c5a95bdcb3130df10410ab0b36e29c8d589 (diff) | |
download | rspamd-68cbb52701b0cb5a331959a3b645e375f4dc3749.tar.gz rspamd-68cbb52701b0cb5a331959a3b645e375f4dc3749.zip |
[Minor] Make panic more informant
Diffstat (limited to 'src/libserver/symcache/symcache_c.cxx')
-rw-r--r-- | src/libserver/symcache/symcache_c.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libserver/symcache/symcache_c.cxx b/src/libserver/symcache/symcache_c.cxx index f8de95281..a2dc08a78 100644 --- a/src/libserver/symcache/symcache_c.cxx +++ b/src/libserver/symcache/symcache_c.cxx @@ -639,11 +639,19 @@ rspamd_symcache_item_async_dec_full(struct rspamd_task *task, auto *real_dyn_item = C_API_SYMCACHE_DYN_ITEM(item); auto *static_item = cache_runtime->get_item_by_dynamic_item(real_dyn_item); - msg_debug_cache_task("increase async events counter for %s(%d) = %d + 1; " + msg_debug_cache_task("decrease async events counter for %s(%d) = %d - 1; " "subsystem %s (%s)", static_item->symbol.c_str(), static_item->id, real_dyn_item->async_events, subsystem, loc); - g_assert(real_dyn_item->async_events > 0); + + if (G_UNLIKELY(real_dyn_item->async_events == 0)) { + msg_err_cache_task("INTERNAL ERROR: trying decrease async events counter for %s(%d) that is already zero; " + "subsystem %s (%s)", + static_item->symbol.c_str(), static_item->id, + real_dyn_item->async_events, subsystem, loc); + g_abort(); + g_assert_not_reached(); + } return --real_dyn_item->async_events; } |