mirror of
https://github.com/corda/corda.git
synced 2025-06-12 20:28:18 +00:00
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:
@ -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")
|
||||
|
Reference in New Issue
Block a user