]> git.ipfire.org Git - thirdparty/asterisk.git/commit
stasis: Don't hold app_registry and session locks unnecessarily
authorGeorge Joseph <gjoseph@digium.com>
Wed, 6 Nov 2019 11:47:17 +0000 (04:47 -0700)
committerGeorge Joseph <gjoseph@digium.com>
Mon, 11 Nov 2019 00:42:16 +0000 (17:42 -0700)
commit40c49ec64f04183ef808467f63297d8acc8df54e
treef46e31a90be3896e674d413cdf52df77bca53a88
parentbe4c6f3f35485a90cb5c1c402fcfa5fd4c4c94af
stasis: Don't hold app_registry and session locks unnecessarily

resource_events:stasis_app_message_handler() was locking the session,
then attempting to determine if the app had debug enabled which
locked the app_registry container.  res_stasis:__stasis_app_register
was locking the app_registry container then calling app_update
which caused app_handler (which locks the session) to run.
The result was a deadlock.

* Updated resource_events:stasis_app_message_handler() to determine
  if debug was set (which locks the app_registry) before obtaining the
  session lock.

* Updated res_stasis:__stasis_app_register to release the app_registry
  container lock before calling app_update (which locks the sesison).

ASTERISK-28423
Reported by Ross Beer

Change-Id: I58c69d08cb372852a63933608e4d6c3e456247b4
res/ari/resource_events.c
res/res_stasis.c