Skip to content
Snippets Groups Projects
Commit b03b7271 authored by Matt Jordan's avatar Matt Jordan
Browse files

main/stasis_cache: Demote the ERROR message when removing a nonexistent item

This patch demotes the ERROR message that is displayed when a
nonexistent item is removed from the Stasis cache. The genesis of this
demotion is due to chan_sip's realtime peers and their interaction with
Asterisk's core ast_endpoint code, but ostensibly it could happen from
other channel drivers as well.

Since Mark Michelson already did an excellent job of explaining on this
issue, it is quoted here for posterity:

"Internally, when a realtime peer is retrieved, Asterisk creates an
ast_endpoint structure. When that peer is destroyed, the ast_endpoint is
destroyed as well. Part of the destruction of the ast_endpoint involves
clearing the Stasis cache of all information about that endpoint. The
problem here is that the act of creating the ast_endpoint is not enough
to actually put any information in the Stasis cache. Instead, something
has to happen, such as a state change, in order for the Stasis cache to
have any information about that endpoint. When a device registers,
chan_sip creates an ast_endpoint structure, processes the REGISTER, and
then destroys the ast_endpoint. When the ast_endpoint is destroyed,
there is nothing to destroy in the Stasis cache, so an error message is
emitted. When you use rtcachefriends, ast_endpoint structures persist
for the lifetime of the module and so you do not see this error
message."

ASTERISK-25237 #close

Change-Id: I53cebc6b4a897a1ab9564182b75c177780feff70
parent d1ef1270
No related branches found
No related tags found
No related merge requests found
......@@ -840,7 +840,7 @@ static void caching_topic_exec(void *data, struct stasis_subscription *sub,
}
ao2_cleanup(update);
} else {
ast_log(LOG_ERROR,
ast_debug(1,
"Attempting to remove an item from the %s cache that isn't there: %s %s\n",
stasis_topic_name(caching_topic->topic),
stasis_message_type_name(msg_type), msg_id);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment