CORDA-2991 (Cont): set node info polling interval to 1 second in DriverDSL Node Startup (#5285)

* Fix test execution flakiness on fast hardware: set node info polling interval to 1 second in DriverDSL Node Startup (was only being set to 1 sec in Node Registration). Follow-up to https://github.com/corda/corda/pull/5240

* Diagnostics: add additional logging to NodeInfoFilersCopier.

* Diagnostics: add additional logging to NodeInfoWatcher

* Downgrade logging level severity to debug.

* Make atomic counter unique across instances.
This commit is contained in:
josecoll
2019-07-17 14:48:46 +01:00
committed by GitHub
parent 1fc1e7d6c8
commit b4749eb8f9
3 changed files with 11 additions and 5 deletions

View File

@ -3,6 +3,7 @@ package net.corda.nodeapi.internal.network
import net.corda.core.internal.*
import net.corda.core.utilities.contextLogger
import net.corda.core.internal.NODE_INFO_DIRECTORY
import net.corda.core.utilities.debug
import rx.Observable
import rx.Scheduler
import rx.Subscription
@ -21,7 +22,7 @@ import java.util.concurrent.TimeUnit
* This class will create paths that it needs to poll and to where it needs to copy files in case those
* don't exist yet.
*/
class NodeInfoFilesCopier(scheduler: Scheduler = Schedulers.io()) : AutoCloseable {
class NodeInfoFilesCopier(private val scheduler: Scheduler = Schedulers.io()) : AutoCloseable {
companion object {
private val log = contextLogger()
@ -122,6 +123,7 @@ class NodeInfoFilesCopier(scheduler: Scheduler = Schedulers.io()) : AutoCloseabl
}
private fun atomicCopy(source: Path, destination: Path) {
log.debug { "[${scheduler.now()}] Copying ... $source -> $destination" }
val tempDestination = try {
Files.createTempFile(destination.parent, "", null)
} catch (exception: IOException) {