Closed clone1018 closed 3 years ago
Confirmed, happened again.
Coredump is at
/root/core.985733
Was able to find the root cause.
JanusFtl::serviceReportThreadBody(...)
holds a lock on JanusFtl::streamDataMutex
while evaluating if clients have exceeded the maximum bitrate setting.
A deadlock can occur if a client exceeding the bitrate cap is stopped while it is in the midst of relaying an RTP packet. Here's the outline:
JanusFtl::serviceThreadReportBody
holds lock on JanusFtl::streamDataMutex
, calls FtlServer::StopStream(...)
FtlServer::StopStream(...)
-> FtlStream::Stop()
-> FtlStream::mediaTransport::Stop()
FtlStream::mediaTransport::Stop()
closes the socket and waits for the connection thread to end.JanusFtl::ftlServerRtpPacket(...)
, and is attempting to acquire a shared lock on JanusFtl::streamDataMutex
, but the lock is already being held by the JanusFtl::serviceThreadReportBody
thread.
I've only seen this happen once, but I wanted to get it on the radar:
Did not take a core dump, will do next time!