Merge pull request #16276 from akka/wip-15530-remote-log-cause-patrikwn

+rem #15530 Include cause in some remote log messages
This commit is contained in:
Patrik Nordwall 2014-11-19 07:42:33 +01:00
commit 4c7adf919f
3 changed files with 9 additions and 6 deletions

View file

@ -548,7 +548,7 @@ class TcpExt(system: ExtendedActorSystem) extends IO.Extension {
val WindowsConnectionAbortWorkaroundEnabled: Boolean = getString("windows-connection-abort-workaround-enabled") match {
case "auto" Helpers.isWindows
case _ => getBoolean("windows-connection-abort-workaround-enabled")
case _ getBoolean("windows-connection-abort-workaround-enabled")
}
private[this] def getIntBytes(path: String): Int = {

View file

@ -210,8 +210,9 @@ private[remote] class ReliableDeliverySupervisor(
override val supervisorStrategy = OneForOneStrategy(loggingEnabled = false) {
case e @ (_: AssociationProblem) Escalate
case NonFatal(e)
log.warning("Association with remote system [{}] has failed, address is now gated for [{}] ms. Reason is: [{}].",
remoteAddress, settings.RetryGateClosedFor.toMillis, e.getMessage)
val causedBy = if (e.getCause == null) "" else s"Caused by: [${e.getCause.getMessage}]"
log.warning("Association with remote system [{}] has failed, address is now gated for [{}] ms. Reason: [{}] {}",
remoteAddress, settings.RetryGateClosedFor.toMillis, e.getMessage, causedBy)
uidConfirmed = false // Need confirmation of UID again
context.become(gated)
currentHandle = None
@ -471,7 +472,7 @@ private[remote] object EndpointWriter {
final case class OutboundAck(ack: Ack)
// These settings are not configurable because wrong configuration will break the auto-tuning
// These settings are not configurable because wrong configuration will break the auto-tuning
private val SendBufferBatchSize = 5
private val MinAdaptiveBackoffNanos = 300000L // 0.3 ms
private val MaxAdaptiveBackoffNanos = 2000000L // 2 ms

View file

@ -439,9 +439,11 @@ private[remote] class EndpointManager(conf: Config, log: LoggingAdapter) extends
OneForOneStrategy(loggingEnabled = false) {
case e @ InvalidAssociation(localAddress, remoteAddress, reason)
keepQuarantinedOr(remoteAddress) {
val causedBy = if (reason.getCause == null) "" else s"Caused by: [${reason.getCause.getMessage}]"
log.warning("Tried to associate with unreachable remote address [{}]. " +
"Address is now gated for {} ms, all messages to this address will be delivered to dead letters. Reason: {}",
remoteAddress, settings.RetryGateClosedFor.toMillis, reason.getMessage)
"Address is now gated for {} ms, all messages to this address will be delivered to dead letters. " +
"Reason: [{}] {}",
remoteAddress, settings.RetryGateClosedFor.toMillis, reason.getMessage, causedBy)
endpoints.markAsFailed(sender(), Deadline.now + settings.RetryGateClosedFor)
}
AddressTerminatedTopic(context.system).publish(AddressTerminated(remoteAddress))