fix(scheduler): downgrade routine EEXIST resync log, dedup hash_string

xce_core_push_events() WARNed on every JOBS_PUSH resync redelivery
(sched_add_job rc=-EEXIST), which is the expected outcome under
on_scheduler_join()'s full resync or the array-push dedup race
(bug-1734/bug-1714) and flooded operational logs. Only that case now
logs via a new DBG() macro (utils.h); any other add_rc (e.g. -ENOMEM)
still WARNs. DBG is named to avoid colliding with the build's own
-DDEBUG command-line define (debug/asan buildtypes).

Also collapsed hash_string()'s duplicated djb2 loop to delegate to
hash_block(), which already implements the same RUN_HASH loop.

Logged as bug-1809 in .wolf/buglog.json.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLSNJhNoULvVcUhXEFafQC
This commit is contained in:
Rongsong Shen 2026-09-15 02:46:52 +00:00
parent 868c6427c8
commit b7250c2ec6
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
7 changed files with 115 additions and 19 deletions

View file

@ -802,12 +802,5 @@ uint32_t hash_block(char* buf, size_t len)
uint32_t hash_string(const char* key)
{
uint32_t hc = 5381;
int c;
while ((c = *key++)) {
hc = RUN_HASH(hc, c);
}
return hc;
return hash_block((char*)key, strlen(key));
}