<p></p>
<p>Access to shared memory is unlocked if shutdown is triggered, otherwise some worker processes can be killed while it acquired the lock, leaving kamailio shutdown worker in deadlock. So there are potential races if you run the rpc commands when you trigger the shut down. Probably you can make your stats fetch script to execute only if shutdown is not triggered, by using a state file created on shutdown command.</p>
<p>Shut down multiprocess races with shared memory access are hard to avoid completely, being a trade between complexity and being able to do a fast restart. If anyone wants to work on this, he/she is more than welcome to propose a pull request.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2433#issuecomment-684764647">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZIFE5GEUCYPYYJ4MWLSDTG2XANCNFSM4PZY2KDA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZIWWFAYLRC4Y74ILQ3SDTG2XA5CNFSM4PZY2KDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFDIK3ZY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2433#issuecomment-684764647",
"url": "https://github.com/kamailio/kamailio/issues/2433#issuecomment-684764647",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>