ENT-3504: Statemachine IllegalStateException logging (BACKPORT)

ENT-3504: Statemachine IllegalStateException logging (BACKPORT)
This commit is contained in:
Jonathan Locke 2019-07-31 16:27:20 +01:00 committed by GitHub
commit f945940cc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -452,12 +452,12 @@ class SingleThreadedStateMachineManager(
}
} else {
// It happens when flows restart and the old sessions messages still arrive from a peer.
logger.info("Cannot find flow corresponding to session ID $recipientId.")
logger.info("Cannot find flow corresponding to session ID - $recipientId.")
}
} else {
val flow = mutex.locked { flows[flowId] }
?: throw IllegalStateException("Cannot find fiber corresponding to ID $flowId")
flow.fiber.scheduleEvent(Event.DeliverSessionMessage(sessionMessage, deduplicationHandler, sender))
mutex.locked { flows[flowId] }?.run {
fiber.scheduleEvent(Event.DeliverSessionMessage(sessionMessage, deduplicationHandler, sender))
} ?: logger.info("Cannot find fiber corresponding to flow ID $flowId")
}
} catch (exception: Exception) {
logger.error("Exception while routing $sessionMessage", exception)