Add logging around the message processing lock.

This commit is contained in:
Greyson Parrelli
2021-02-25 14:55:13 -05:00
committed by Alan Evans
parent 32aea8d154
commit 8f7f836598
2 changed files with 36 additions and 0 deletions

View File

@@ -113,7 +113,14 @@ public class IncomingMessageProcessor {
stopwatch.split("queue-check");
long ownerThreadId = DatabaseSessionLock.INSTANCE.getLikeyOwnerThreadId();
if (ownerThreadId != DatabaseSessionLock.NO_OWNER && ownerThreadId != Thread.currentThread().getId()) {
Log.i(TAG, "It is likely that some other thread has this lock. Owner: " + ownerThreadId + ", Us: " + Thread.currentThread().getId());
}
try (SignalSessionLock.Lock unused = DatabaseSessionLock.INSTANCE.acquire()) {
Log.i(TAG, "Acquired lock while processing message " + envelope.getTimestamp() + ".");
DecryptionResult result = MessageDecryptionUtil.decrypt(context, envelope);
stopwatch.split("decrypt");