mirror of
https://github.com/corda/corda.git
synced 2025-01-30 08:04:16 +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) {
|
override fun stop() = synchronized(this) {
|
||||||
started?.run {
|
started?.run {
|
||||||
producer.close()
|
producer.close()
|
||||||
// Ensure any trailing messages are committed to the journal
|
// Since we are leaking the session outside of this class it may well be already closed.
|
||||||
session.commit()
|
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.
|
// Closing the factory closes all the sessions it produced as well.
|
||||||
sessionFactory.close()
|
sessionFactory.close()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user