[Asterisk-code-review] taskprocessor.c: Prevent crash on graceful shutdown (asterisk[16])

Michael Bradeen asteriskteam at digium.com
Tue Feb 8 20:14:29 CST 2022


Attention is currently required from: Joshua Colp, Kevin Harwell, Benjamin Keith Ford.
Michael Bradeen has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/17955 )

Change subject: taskprocessor.c: Prevent crash on graceful shutdown
......................................................................


Patch Set 5:

(1 comment)

File main/taskprocessor.c:

https://gerrit.asterisk.org/c/asterisk/+/17955/comment/feda63cb_20299842 
PS5, Line 298: 	/* During shutdown there may still be taskprocessor threads running and those
             : 	 * tasprocessors reference tps_singletons.  When those taskprocessors finish
             : 	 * they will call ast_taskprocessor_unreference, creating a race condition which
             : 	 * can result in tps_singletons being referenced after being deleted. To try and
             : 	 * avoid this we check the container count and if greater than zero, give the
             : 	 * running taskprocessors a chance to finish */
> Not sure if this is the right fix here. Kinda feels like a "hack". […]
This idea of killing the taskprocessor is appealing, but it seems that each module doesn't do the cleanup itself then we risk an issue in that module leaking or asserting.

The module cleanup is done first, but they don't all join as part of cleanup so you aren't guaranteed they will be done by the time we are cleaning up taskprocessor itself. 

The taskprocessor shutdown I am also not sure how to do universally as taskprocessors can define their own listeners.



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

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Ia932fc003d316389b9c4fd15ad6594458c9727f1
Gerrit-Change-Number: 17955
Gerrit-PatchSet: 5
Gerrit-Owner: Michael Bradeen <mbradeen at sangoma.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Attention: Joshua Colp <jcolp at sangoma.com>
Gerrit-Attention: Kevin Harwell <kharwell at digium.com>
Gerrit-Attention: Benjamin Keith Ford <bford at digium.com>
Gerrit-Comment-Date: Wed, 09 Feb 2022 02:14:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220208/941a00cd/attachment.html>


More information about the asterisk-code-review mailing list