Changes in logging (#145)
- move noisy logging to trace level - log entire broken ws message
This commit is contained in:
@@ -74,7 +74,7 @@ abstract class AbstractHead @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
return source
|
return source
|
||||||
.filter {
|
.filter {
|
||||||
log.debug("Filtering block $upstreamId block $it")
|
log.trace("Filtering block $upstreamId block $it")
|
||||||
forkChoice.filter(it)
|
forkChoice.filter(it)
|
||||||
}
|
}
|
||||||
.doFinally {
|
.doFinally {
|
||||||
@@ -85,7 +85,7 @@ abstract class AbstractHead @JvmOverloads constructor(
|
|||||||
log.warn("Received signal $upstreamId $it unexpectedly - restart head")
|
log.warn("Received signal $upstreamId $it unexpectedly - restart head")
|
||||||
lastHeadUpdated = 0L
|
lastHeadUpdated = 0L
|
||||||
} else {
|
} else {
|
||||||
log.warn("Received signal $upstreamId $it - stop emit new head!!!")
|
log.warn("Received signal $upstreamId $it - stop emit new head")
|
||||||
completed = true
|
completed = true
|
||||||
stream.tryEmitComplete()
|
stream.tryEmitComplete()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ abstract class DefaultUpstream(
|
|||||||
Status(curr.lag, avail, statusByLag(curr.lag, avail))
|
Status(curr.lag, avail, statusByLag(curr.lag, avail))
|
||||||
}.also {
|
}.also {
|
||||||
statusStream.emitNext(it.status) { _, res -> res == Sinks.EmitResult.FAIL_NON_SERIALIZED }
|
statusStream.emitNext(it.status) { _, res -> res == Sinks.EmitResult.FAIL_NON_SERIALIZED }
|
||||||
log.debug("Status of upstream [$id] changed to [$it], requested change status to [$avail]")
|
log.trace("Status of upstream [$id] changed to [$it], requested change status to [$avail]")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ abstract class DefaultUpstream(
|
|||||||
Status(nLag, curr.avail, statusByLag(nLag, curr.avail))
|
Status(nLag, curr.avail, statusByLag(nLag, curr.avail))
|
||||||
}.also {
|
}.also {
|
||||||
statusStream.emitNext(it.status) { _, res -> res == Sinks.EmitResult.FAIL_NON_SERIALIZED }
|
statusStream.emitNext(it.status) { _, res -> res == Sinks.EmitResult.FAIL_NON_SERIALIZED }
|
||||||
log.debug("Status of upstream [$id] changed to [$it], requested change lag to [$lag]")
|
log.trace("Status of upstream [$id] changed to [$it], requested change lag to [$lag]")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ open class WsConnectionImpl(
|
|||||||
}
|
}
|
||||||
onMessage(msg)
|
onMessage(msg)
|
||||||
} catch (t: Throwable) {
|
} catch (t: Throwable) {
|
||||||
log.warn("Failed to process WS message. ${t.javaClass}: ${t.message}")
|
log.warn("Failed to process WS message. ${t.javaClass}: ${t.message}. Message: ${String(it)}")
|
||||||
Mono.empty()
|
Mono.empty()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,23 +27,23 @@ class PriorityForkChoice : ForkChoice {
|
|||||||
|
|
||||||
override fun choose(block: BlockContainer): ForkChoice.ChoiceResult {
|
override fun choose(block: BlockContainer): ForkChoice.ChoiceResult {
|
||||||
head.get()?.let {
|
head.get()?.let {
|
||||||
log.debug("Candidate for priority forkchoice (${block.height}, ${block.nodeRating}), current is (${it.height},${it.nodeRating})")
|
log.trace("Candidate for priority forkchoice (${block.height}, ${block.nodeRating}), current is (${it.height},${it.nodeRating})")
|
||||||
}
|
}
|
||||||
val nwhead = head.updateAndGet { curr ->
|
val nwhead = head.updateAndGet { curr ->
|
||||||
if (!filter(block)) {
|
if (!filter(block)) {
|
||||||
log.debug("Preparing to deny block ${block.height}")
|
log.trace("Preparing to deny block ${block.height}")
|
||||||
curr
|
curr
|
||||||
} else {
|
} else {
|
||||||
log.debug("Preparing to accept block ${block.height}")
|
log.trace("Preparing to accept block ${block.height}")
|
||||||
seenBlocks.put(block.hash, true)
|
seenBlocks.put(block.hash, true)
|
||||||
block
|
block
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nwhead.hash == block.hash) {
|
if (nwhead.hash == block.hash) {
|
||||||
log.debug("Accepted block ${block.height}")
|
log.trace("Accepted block ${block.height}")
|
||||||
return ForkChoice.ChoiceResult.Updated(nwhead)
|
return ForkChoice.ChoiceResult.Updated(nwhead)
|
||||||
}
|
}
|
||||||
log.debug("Denied block ${block.height}")
|
log.trace("Denied block ${block.height}")
|
||||||
return ForkChoice.ChoiceResult.Same(nwhead)
|
return ForkChoice.ChoiceResult.Same(nwhead)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user