Merge pull request #1573 from drewhk/wip-3475-always-log-error-remoting-drewhk

Error level remoting events are logged by default #3475
This commit is contained in:
Roland Kuhn 2013-07-04 04:58:11 -07:00
commit 23060f1d03
2 changed files with 16 additions and 15 deletions

View file

@ -431,8 +431,8 @@ private[remote] class EndpointWriter(
throw reason
}
private def publishAndStay(reason: Throwable): State = {
publishError(reason)
private def logAndStay(reason: Throwable): State = {
log.error(reason, "Transient association error (association remains live)")
stay()
}
@ -511,7 +511,7 @@ private[remote] class EndpointWriter(
remoteMetrics.logPayloadBytes(msg, pduSize)
if (pduSize > transport.maximumPayloadBytes) {
publishAndStay(new OversizedPayloadException(s"Discarding oversized payload sent to ${recipient}: max allowed size ${transport.maximumPayloadBytes} bytes, actual size of encoded ${msg.getClass} was ${pdu.size} bytes."))
logAndStay(new OversizedPayloadException(s"Discarding oversized payload sent to ${recipient}: max allowed size ${transport.maximumPayloadBytes} bytes, actual size of encoded ${msg.getClass} was ${pdu.size} bytes."))
} else if (h.write(pdu)) {
stay()
} else {
@ -522,7 +522,7 @@ private[remote] class EndpointWriter(
throw new EndpointException("Internal error: Endpoint is in state Writing, but no association handle is present.")
}
} catch {
case e: NotSerializableException publishAndStay(e)
case e: NotSerializableException logAndStay(e)
case e: EndpointException publishAndThrow(e)
case NonFatal(e) publishAndThrow(new EndpointException("Failed to write message to the transport", e))
}
@ -705,8 +705,9 @@ private[remote] class EndpointReader(
}
case InboundPayload(oversized)
publishError(new OversizedPayloadException(s"Discarding oversized payload received: " +
s"max allowed size [${transport.maximumPayloadBytes}] bytes, actual size [${oversized.size}] bytes."))
log.error(new OversizedPayloadException(s"Discarding oversized payload received: " +
s"max allowed size [${transport.maximumPayloadBytes}] bytes, actual size [${oversized.size}] bytes."),
"Transient error while reading from association (association remains live)")
case StopReading(writer)
saveState()