Module: kamailio
Branch: master
Commit: f3f87ca550d44364e3c6cc1653970258fdffaa2c
URL:
https://github.com/kamailio/kamailio/commit/f3f87ca550d44364e3c6cc165397025…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-05-04T20:07:35+02:00
cdp: don't lock anymore for session during shutdown callbacks
- if sigterm killed a worker in a locked zone, results in a deadlock at
shutdown. The cleanup is done by a sigle process, no other processes
run, therefore no more race
---
Modified: modules/cdp/session.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f3f87ca550d44364e3c6cc165397025…
Patch:
https://github.com/kamailio/kamailio/commit/f3f87ca550d44364e3c6cc165397025…
---
diff --git a/modules/cdp/session.c b/modules/cdp/session.c
index 716048f..4c7b0bc 100644
--- a/modules/cdp/session.c
+++ b/modules/cdp/session.c
@@ -73,6 +73,7 @@ unsigned int *session_id2; /**< counter for second part of the
session id */
*/
inline void AAASessionsLock(unsigned int hash)
{
+ if(_sr_destroy_modules_phase==1) return;
if ( hash >=0 && hash < sessions_hash_size ){
lock_get(sessions[hash].lock);
}
@@ -86,6 +87,7 @@ inline void AAASessionsLock(unsigned int hash)
*/
inline void AAASessionsUnlock(unsigned int hash)
{
+ if(_sr_destroy_modules_phase==1) return;
if ( hash >=0 && hash < sessions_hash_size ){
lock_release(sessions[hash].lock);