CORDA-3726: Remove memory leaks when many InProcess nodes started (#6169)

* CORDA-3762: Integration test exposing the problem reported

* CORDA-3726: Additional logging

* CORDA-3726: Prevent thread leaks

* CORDA-3726: New `journalBufferTimeout` parameter

* CORDA-3726: Override `journalBufferTimeout` parameter

* CORDA-3726: Making Detekt happier

* CORDA-3276: Account for extra thread user in MockNetwork

For real node this does not matter as `shutdown` can safely be called multiple times, which is not true for server thread provided by MockNetwork

* CORDA-3276: Do not make SMM shutdown "executor" as it belongs to AbstractNode

* CORDA-3276: Address input from @rick-r3

* CORDA-3276: Fix test after rebase
This commit is contained in:
Viktor Kolomeyko
2020-04-23 08:53:51 +01:00
committed by GitHub
parent f3c78c02da
commit 257026f606
16 changed files with 109 additions and 29 deletions

View File

@ -289,7 +289,13 @@ class CordaPersistence(
override fun close() {
// DataSource doesn't implement AutoCloseable so we just have to hope that the implementation does so that we can close it
(_dataSource as? AutoCloseable)?.close()
val mayBeAutoClosableDataSource = _dataSource as? AutoCloseable
if(mayBeAutoClosableDataSource != null) {
log.info("Closing $mayBeAutoClosableDataSource")
mayBeAutoClosableDataSource.close()
} else {
log.warn("$_dataSource has not been properly closed")
}
}
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN")