-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
What version of Janus is this happening on?
1.3.2, our branch based on fd24309 commit(audiobridge isn't modified by us)
Have you tested a more recent version of Janus too?
Not yet, but we hit a deadlock condition on one of our customers using the specified version.
Was this working before?
not sure
Is there a gdb or libasan trace of the issue?
Here are gdb logs from two broken servers:
https://gist.github.com/spscream/7dafebd6bb1a39493f838aebf88fba26
Additional context
I looked into the code of ab, in janus_audiobridge_handler:
janus-gateway/src/plugins/janus_audiobridge.c
Line 6557 in fd24309
| janus_mutex_lock(&sessions_mutex); |
a mutex is locked here.
and in
janus-gateway/src/plugins/janus_audiobridge.c
Line 6677 in fd24309
| janus_mutex_lock(&rooms_mutex); |
it locks rooms_mutex
So the lock order is: lock sessions_mutex -> lock rooms_mutex -> unlock rooms_mutex-> unlock sessions_mutex
This could possibly lead to a deadlock condition in other places, e.g. here:
janus-gateway/src/plugins/janus_audiobridge.c
Line 2957 in fd24309
| janus_mutex_lock(&sessions_mutex); |
Here the lock order is: lock sessions_mutex -> unlock sessions_mutex -> lock rooms_mutex -> unlock rooms_mutex
I'm not sure this is exactly our case, but it could potentially lead to such a condition in other places too.