Skip to content

Commit

Permalink
log address having heartbeat problems in PhiAccrualFailureDetector (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
shkoder committed Jun 26, 2018
1 parent b8230a3 commit 1ea24cd
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -47,6 +47,13 @@ class DefaultFailureDetectorRegistry[A](detectorFactory: () ⇒ FailureDetector)
failureDetector.heartbeat()
case None
val newDetector: FailureDetector = detectorFactory()

// FIXME: fix this binary compatibility hack in 2.6
newDetector match {
case phi: PhiAccrualFailureDetector phi.address = resource.toString
case _
}

newDetector.heartbeat()
resourceToFailureDetector.set(oldTable + (resource newDetector))
}
Original file line number Diff line number Diff line change
@@ -104,6 +104,9 @@ class PhiAccrualFailureDetector(

private val acceptableHeartbeatPauseMillis = acceptableHeartbeatPause.toMillis

// FIXME: fix this binary compatibility hack in 2.6
private[akka] var address: String = "N/A"

/**
* Implement using optimistic lockless concurrency, all state is represented
* by this immutable case class and managed by an AtomicReference.
@@ -135,7 +138,7 @@ class PhiAccrualFailureDetector(
// don't use the first heartbeat after failure for the history, since a long pause will skew the stats
if (isAvailable(timestamp)) {
if (interval >= (acceptableHeartbeatPauseMillis / 3 * 2) && eventStream.isDefined)
eventStream.get.publish(Warning(this.toString, getClass, s"heartbeat interval is growing too large: $interval millis"))
eventStream.get.publish(Warning(this.toString, getClass, s"heartbeat interval is growing too large for address $address: $interval millis"))
oldState.history :+ interval
} else oldState.history
}

0 comments on commit 1ea24cd

Please sign in to comment.