mirror of https://github.com/asterisk/asterisk
manager.c: Don't block the AMI accept thread on busy session locks. new AMI connections can stall under load. purge_sessions() runs from the AMI accept loop and took every session's lock while looking for expired HTTP sessions. A session thread holding its lock (for example while writing events to a slow client) stalled the accept thread, so new AMI connections queued up and could overflow the listen queue. Use ao2_trylock() and skip sessions that are currently locked. Expired session cleanup is opportunistic; a skipped session is checked again on a later pass. Assisted-by: Claude (Anthropic AI assistant) Resolves: #2248pull/2276/head
parent
19b06ff2c6
commit
552c5f56e9
Loading…
Reference in new issue