mirror of
https://github.com/corda/corda.git
synced 2025-06-13 20:58:19 +00:00
ENT-2489: Gracefully handle session that might have already been closed. (#3933)
This commit is contained in:
@ -58,8 +58,11 @@ class ArtemisMessagingClient(private val config: MutualSslConfiguration,
|
||||
override fun stop() = synchronized(this) {
|
||||
started?.run {
|
||||
producer.close()
|
||||
// Ensure any trailing messages are committed to the journal
|
||||
session.commit()
|
||||
// Since we are leaking the session outside of this class it may well be already closed.
|
||||
if(!session.isClosed) {
|
||||
// Ensure any trailing messages are committed to the journal
|
||||
session.commit()
|
||||
}
|
||||
// Closing the factory closes all the sessions it produced as well.
|
||||
sessionFactory.close()
|
||||
}
|
||||
|
Reference in New Issue
Block a user