While running b2bua tests under load, we see thread deadlocks (see attachment).
It's a race condition, so will only happen sporadically.
What appears to be happening is that one thread is getting the ACK from the UAC
and has locked the SAS and then goes to lock the Dialog Life Cycle. Meanwhile,
another thread is getting a 180 OK from the UAS (because we handle things out of
order....), and it locks the Dialog Life Cycle first and then tries to lock the SAS.
As a result, the life cycle object remains locked forever, and the dialog
cleaner can no longer run. This in turn prevents SAS from being cleaned up
properly, and the instances gets an OutOfMemoryException.