Log stacktrace on deserialization error (#31432)

Deserialization errors are usually programming errors that
are not really recoverable, so it seems to make sense to
log at the ERROR level, plus this gives the operator
access to the stacktrace which might be helpful in diagnosing
the problem.
This commit is contained in:
Arnout Engelen 2022-06-13 09:47:25 +02:00 committed by GitHub
parent 462b473899
commit 3f61dfdbac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -681,12 +681,12 @@ private[remote] class Deserializer(
case OptionVal.Some(a) => a.remoteAddress
case _ => "unknown"
}
log.warning(
"Failed to deserialize message from [{}] with serializer id [{}] and manifest [{}]. {}",
log.error(
e,
"Failed to deserialize message from [{}] with serializer id [{}] and manifest [{}].",
from,
envelope.serializer,
envelope.classManifest,
e)
envelope.classManifest)
pull(in)
} finally {
val buf = envelope.envelopeBuffer

View file

@ -59,7 +59,7 @@ class SerializationErrorSpec extends ArteryMultiNodeSpec(ArterySpecSupport.defau
expectMsg("ping")
EventFilter
.warning(pattern = """Failed to deserialize message from \[.*\] with serializer id \[4\]""", occurrences = 1)
.error(pattern = """Failed to deserialize message from \[.*\] with serializer id \[4\]""", occurrences = 1)
.intercept {
remoteRef ! "boom".getBytes("utf-8")
}(systemB)