[asterisk-commits] main/stasis cache: Demote the ERROR message when removing a ... (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 15 05:19:46 CDT 2017


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/5183 )

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


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
---
M main/stasis_cache.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/main/stasis_cache.c b/main/stasis_cache.c
index 9129c00..b0973b9 100644
--- a/main/stasis_cache.c
+++ b/main/stasis_cache.c
@@ -842,7 +842,7 @@
 			}
 			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);

-- 
To view, visit https://gerrit.asterisk.org/5183
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I53cebc6b4a897a1ab9564182b75c177780feff70
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-commits mailing list