Description
In RedisAdapter.cpp:274-280, add_reader_helper inserts into _reader[token] before checking if token == NO_TOKEN:
uint32_t token = reader_token(key);
reader_info& info = _reader[token]; // creates _reader[NO_TOKEN] entry
info.subs[key].push_back(func);
info.keyids[key] = "$";
if (token == NO_TOKEN) return false; // too late — entry already created
While the reconnect logic (line 426) does handle NO_TOKEN entries, this ordering is fragile and creates map entries that may never be cleaned up if reconnect doesn't fire.
Severity
High
Suggested Fix
Either check token == NO_TOKEN before accessing the map, or add a comment documenting this as intentional behavior for the reconnect path.
Description
In
RedisAdapter.cpp:274-280,add_reader_helperinserts into_reader[token]before checking iftoken == NO_TOKEN:While the reconnect logic (line 426) does handle
NO_TOKENentries, this ordering is fragile and creates map entries that may never be cleaned up if reconnect doesn't fire.Severity
High
Suggested Fix
Either check
token == NO_TOKENbefore accessing the map, or add a comment documenting this as intentional behavior for the reconnect path.