[Asterisk-code-review] Fix deadlock handling subscribe req during res parking reload (asterisk[13])

Giuseppe Sucameli asteriskteam at digium.com
Fri Dec 7 04:33:11 CST 2018


Giuseppe Sucameli has posted comments on this change. ( https://gerrit.asterisk.org/10701 )

Change subject: Fix deadlock handling subscribe req during res_parking reload
......................................................................


Patch Set 2:

(1 comment)

Patchset 2 is correct. I've replied inline to explain why.

Sorry for the noise, but I implemented the fix about one year ago (was January). In the meanwhile I've forgotten many details, but I can just say it's 11 months we are using it w/o any issue.

https://gerrit.asterisk.org/#/c/10701/2/main/pbx.c
File main/pbx.c:

https://gerrit.asterisk.org/#/c/10701/2/main/pbx.c@3316
PS2, Line 3316: 		/* The extension has already been destroyed,
              : 		 * notify extension deactivation
              : 		 */
> AFAICT it may happen since the device_state_notify_callbacks
 > function is called from both handle_hint_change_message_type() (via
 > stasis) and device_state_cb().

I was wrong, it cannot happen.

The handle_hint_change_message_type() is called from device_state_cb(). device_state_cb() checks for handle_hint_change_message_type() return value and if succeded it returns w/o calling device_state_notify_callbacks again...
Furthermore, once the ast_remove_hint is called no other functions can publish a hint_change stasis message for the same hint.

I'm going to revert patchset 3 and improve the comment to explain why.

In addition I'll remove the check for not null hint->callbacks since it's removed within hint destructor (but here we still hold a ref to the hint).



-- 
To view, visit https://gerrit.asterisk.org/10701
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: I5b03c3455b3b12b6f83cea4cc34f4b4b20444f7e
Gerrit-Change-Number: 10701
Gerrit-PatchSet: 2
Gerrit-Owner: Giuseppe Sucameli <sucameli at netresults.it>
Gerrit-Reviewer: Giuseppe Sucameli <sucameli at netresults.it>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Comment-Date: Fri, 07 Dec 2018 10:33:11 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181207/32885780/attachment-0001.html>


More information about the asterisk-code-review mailing list