]> git.ipfire.org Git - thirdparty/asterisk.git/commit
main/stasis_cache: Demote the ERROR message when removing a nonexistent item
authorMatt Jordan <mjordan@digium.com>
Tue, 14 Mar 2017 14:37:34 +0000 (09:37 -0500)
committerMatt Jordan <mjordan@digium.com>
Tue, 14 Mar 2017 14:37:34 +0000 (09:37 -0500)
commit216e28aa9575a13554eb6febf8a6cd8cc12cd9d6
tree76c4cb7208b3692c13302ad3e3a109a0be7ccb2e
parent523de8eb8e0f7283b6c9210d5da0df541684e784
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
main/stasis_cache.c