mirror of
https://github.com/corda/corda.git
synced 2025-01-29 15:43:55 +00:00
ENT-2489: Gracefully handle session that might have already been closed. (#3933)
This commit is contained in:
parent
057ee74611
commit
0c1910722b
@ -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()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user