aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Topolnjak <ivantopo@gmail.com>2015-04-22 01:59:46 +0200
committerIvan Topolnjak <ivantopo@gmail.com>2015-04-22 01:59:46 +0200
commita2840a7020df81056a656d3e88be223f7af62ac6 (patch)
tree4fa59fe9a706019134fd130c676734c9ff96cccd
parent5cb9de39cdd6ef258732a82e6f0d519712d1c37b (diff)
downloadKamon-a2840a7020df81056a656d3e88be223f7af62ac6.tar.gz
Kamon-a2840a7020df81056a656d3e88be223f7af62ac6.tar.bz2
Kamon-a2840a7020df81056a656d3e88be223f7af62ac6.zip
= akka: correctly handle invoke errors while processing system messages, fixes #184.
-rw-r--r--kamon-akka/src/main/scala/kamon/akka/instrumentation/ActorCellInstrumentation.scala7
1 files changed, 6 insertions, 1 deletions
diff --git a/kamon-akka/src/main/scala/kamon/akka/instrumentation/ActorCellInstrumentation.scala b/kamon-akka/src/main/scala/kamon/akka/instrumentation/ActorCellInstrumentation.scala
index deb43499..bfcc0ed0 100644
--- a/kamon-akka/src/main/scala/kamon/akka/instrumentation/ActorCellInstrumentation.scala
+++ b/kamon-akka/src/main/scala/kamon/akka/instrumentation/ActorCellInstrumentation.scala
@@ -117,7 +117,12 @@ class ActorCellInstrumentation {
// In case that this actor is behind a router, count the errors for the router as well.
val envelope = cell.currentMessage.asInstanceOf[RouterAwareEnvelope]
- envelope.routerMetricsRecorder.map(_.errors.increment())
+ if (envelope ne null) {
+ // The ActorCell.handleInvokeFailure(..) method is also called when a failure occurs
+ // while processing a system message, in which case ActorCell.currentMessage is always
+ // null.
+ envelope.routerMetricsRecorder.map(_.errors.increment())
+ }
}
}