(Thanks for the answers quick release)
Michael
2014-08-05 10:15:51,024 ERROR [scoring-service-akka.actor.default-dispatcher-9] akka.actor.OneForOneStrategy - index 7040
java.lang.IndexOutOfBoundsException: index 7040
at java.util.concurrent.atomic.AtomicLongArray.checkedByteOffset(AtomicLongArray.java:64)
at java.util.concurrent.atomic.AtomicLongArray.addAndGet(AtomicLongArray.java:256)
at java.util.concurrent.atomic.AtomicLongArray.incrementAndGet(AtomicLongArray.java:235)
at org.HdrHistogram.AtomicHistogram.incrementCountAtIndex(AtomicHistogram.java:34)
at org.HdrHistogram.AbstractHistogram.recordSingleValue(AbstractHistogram.java:295)
at org.HdrHistogram.AbstractHistogram.recordValue(AbstractHistogram.java:372)
at kamon.metric.instrument.HdrHistogram.record(Histogram.scala:105)
at kamon.metric.instrument.PaddedMinMaxCounter.refreshValues(MinMaxCounter.scala:110)
at kamon.metric.instrument.PaddedMinMaxCounter.collect(MinMaxCounter.scala:89)
at kamon.metric.instrument.PaddedMinMaxCounter.collect(MinMaxCounter.scala:65)
at kamon.metric.ActorMetrics$ActorMetricsRecorder.collect(ActorMetrics.scala:42)
at kamon.metric.ActorMetrics$ActorMetricsRecorder.collect(ActorMetrics.scala:35)
at kamon.metric.Subscriptions$$anonfun$collectAll$1.apply(Subscriptions.scala:83)
at kamon.metric.Subscriptions$$anonfun$collectAll$1.apply(Subscriptions.scala:82)
at scala.collection.Iterator$class.foreach(Iterator.scala:743)
at scala.collection.concurrent.TrieMapIterator.foreach(TrieMap.scala:923)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.concurrent.TrieMap.foreach(TrieMap.scala:633)
at kamon.metric.Subscriptions.collectAll(Subscriptions.scala:82)
at kamon.metric.Subscriptions.flush(Subscriptions.scala:69)
at kamon.metric.Subscriptions$$anonfun$receive$1.applyOrElse(Subscriptions.scala:41)
at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
at kamon.metric.Subscriptions.aroundReceive(Subscriptions.scala:27)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
at akka.actor.ActorCell.invoke_aroundBody0(ActorCell.scala:487)
at akka.actor.ActorCell$AjcClosure1.run(ActorCell.scala:1)
at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
at akka.instrumentation.ActorCellInstrumentation$$anonfun$aroundBehaviourInvoke$1.apply(ActorCellInstrumentation.scala:56)
at kamon.trace.TraceRecorder$.withTraceContext(TraceRecorder.scala:69)
at akka.instrumentation.ActorCellInstrumentation.aroundBehaviourInvoke(ActorCellInstrumentation.scala:55)
at akka.actor.ActorCell.invoke(ActorCell.scala:483)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)
at akka.dispatch.Mailbox.run(Mailbox.scala:220)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Michael,
Thanks for reporting this issue and trying out 0.3.3 right away! That error happens when a value that is lower than zero or greater than the highest trackable value is written to a histogram like the one backing the mailbox size observations.. We already have some code to protect us from that issue and I'm not sure of why it failed this time.. Does it always fail when starting your app? Is it reproducible? any info that can help us reproduce it would be greatly appreciated.
Also, just to give you a little background on why we did that: for monitoring mailboxes we have this thing called a MinMaxCounter, which internally has 3 structures tracking the min, max and current value of the mailbox.. In a fixed interval we read those three values and store them in a histogram that will eventually be flushed to all registered reporters. Our instrumentation increments by one after a message has been successfully queued in mailbox and decrements by one when a message is dequeued from the mailbox... this sounds like it should never fall bellow zero, but it turns out that akka internally schedules the actor for execution when the message is queued in the mailbox and with some lucky (or unlucky if you like it better) timings the message will be dequeued for processing by another thread before the call to `sendMessage` in the ActorCell completes, making the mailbox size fall to -1 and quickly get back to 0. For a MinMaxCounter, if the values fall bellow zero we assume them to be zero and there (in theory) is no chance that a value bellow zero is recorded.. I'll investigate more on this and try to reproduce it somehow, will keep you posted, best regards!
I'm not doing anything with actors "manually" - just a spray app so creating one HttpServiceActor and sending a Http.Bind to start the server. Anything else will be spray internals. I don't collect the reply so there's at least one message to dead.letters. The only other slightly weird thing I can think of about my code is that I sometimes call TraceRecorder.finish() without a trace present (which gives a warning), because I have some code that can be called either from spray code or from other code in which I manually start a transaction.
Storage of min [-9223372036854775808] is about to fail, current=0, maxTrackableValue=999999999, significantDigits=2
2014-08-06 09:27:30,668 ERROR [scoring-service-akka.actor.default-dispatcher-14] akka.actor.OneForOneStrategy - index 7040
java.lang.IndexOutOfBoundsException: index 7040
at java.util.concurrent.atomic.AtomicLongArray.checkedByteOffset(AtomicLongArray.java:64)
at java.util.concurrent.atomic.AtomicLongArray.addAndGet(AtomicLongArray.java:256)
at java.util.concurrent.atomic.AtomicLongArray.incrementAndGet(AtomicLongArray.java:235)
at org.HdrHistogram.AtomicHistogram.incrementCountAtIndex(AtomicHistogram.java:34)
at org.HdrHistogram.AbstractHistogram.recordSingleValue(AbstractHistogram.java:295)
at org.HdrHistogram.AbstractHistogram.recordValue(AbstractHistogram.java:372)
at kamon.metric.instrument.HdrHistogram.record(Histogram.scala:105)
at kamon.metric.instrument.PaddedMinMaxCounter.refreshValues(MinMaxCounter.scala:114)
Storing of [-9223372036854775808] will fail, current=0, highestTrackableValue=999999999
[ERROR] [08/07/2014 11:32:49.746] [xyz-akka.actor.default-dispatcher-26] [akka://xyz/user/kamon-metrics-subscriptions] index 7040
java.lang.IndexOutOfBoundsException: index 7040
at java.util.concurrent.atomic.AtomicLongArray.checkedByteOffset(AtomicLongArray.java:64)
at java.util.concurrent.atomic.AtomicLongArray.addAndGet(AtomicLongArray.java:256)
at java.util.concurrent.atomic.AtomicLongArray.incrementAndGet(AtomicLongArray.java:235)
at org.HdrHistogram.AtomicHistogram.incrementCountAtIndex(AtomicHistogram.java:36)
at org.HdrHistogram.AbstractHistogram.recordSingleValue(AbstractHistogram.java:285)
at org.HdrHistogram.AbstractHistogram.recordValue(AbstractHistogram.java:216)
at kamon.metric.instrument.HdrHistogram.record(Histogram.scala:105)
at kamon.metric.instrument.PaddedMinMaxCounter.refreshValues(MinMaxCounter.scala:113)
Storing of [-9223372036854775808] will fail, current=0, highestTrackableValue=999999999
[ERROR] [08/07/2014 11:32:49.780] [FireFly-akka.actor.default-dispatcher-34] [akka://FireFly/user/kamon-metrics-subscriptions] index 7040
java.lang.IndexOutOfBoundsException: index 7040
at java.util.concurrent.atomic.AtomicLongArray.checkedByteOffset(AtomicLongArray.java:64)
at java.util.concurrent.atomic.AtomicLongArray.addAndGet(AtomicLongArray.java:256)
at java.util.concurrent.atomic.AtomicLongArray.incrementAndGet(AtomicLongArray.java:235)
at org.HdrHistogram.AtomicHistogram.incrementCountAtIndex(AtomicHistogram.java:36)
at org.HdrHistogram.AbstractHistogram.recordSingleValue(AbstractHistogram.java:285)
at org.HdrHistogram.AbstractHistogram.recordValue(AbstractHistogram.java:216)
at kamon.metric.instrument.HdrHistogram.record(Histogram.scala:105)
at kamon.metric.instrument.PaddedMinMaxCounter.refreshValues(MinMaxCounter.scala:113)
--
You received this message because you are subscribed to the Google Groups "kamon-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kamon-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "kamon-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kamon-user/ph568abmR0s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kamon-user+...@googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "kamon-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kamon-user/ph568abmR0s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kamon-user+...@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "kamon-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kamon-user/ph568abmR0s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kamon-user+...@googlegroups.com.
One of the things that almost confused me was that initially I still had the 0.3.3 jars left behind which caused the new ones to be disregarded due to classpath precedence. Luckily the stacktrace easily clarifies this.
Are you entirely sure that you were running the latest Kamon snapshot when the issue was reproduced? I found a way to reproduce the problem and testing many times against 2.10 and 2.11 branches before releasing.. let us know what you find, thanks!
--
Is there something I can do to help debug this?
[ERROR] [08/28/2014 06:59:59.772] [cpy-engine-akka.actor.default-dispatcher-13] [ActorSystem(cpy-engine)] Uncaught error from thread [cpy-engine-akka.actor.default-dispatcher-13]
java.lang.IndexOutOfBoundsException: index 4963
at java.util.concurrent.atomic.AtomicLongArray.checkedByteOffset(AtomicLongArray.java:64)
at java.util.concurrent.atomic.AtomicLongArray.addAndGet(AtomicLongArray.java:256)
at java.util.concurrent.atomic.AtomicLongArray.incrementAndGet(AtomicLongArray.java:235)
at org.HdrHistogram.AtomicHistogram.incrementCountAtIndex(AtomicHistogram.java:34)
at org.HdrHistogram.AbstractHistogram.recordSingleValue(AbstractHistogram.java:295)
at org.HdrHistogram.AbstractHistogram.recordValue(AbstractHistogram.java:372)
at kamon.metric.instrument.HdrHistogram.record(Histogram.scala:105)
at akka.instrumentation.ActorCellInstrumentation$$anonfun$aroundBehaviourInvoke$1.apply(ActorCellInstrumentation.scala:62)
at akka.instrumentation.ActorCellInstrumentation$$anonfun$aroundBehaviourInvoke$1.apply(ActorCellInstrumentation.scala:60)
at scala.Option.map(Option.scala:145)
at akka.instrumentation.ActorCellInstrumentation.aroundBehaviourInvoke(ActorCellInstrumentation.scala:59)
I know the settings are picked up because we are doing a dump of the whole config on startup, and there the mailbox.highest trackable value is at 108..... So I assume that your ConfigFactory gets the same values.
If you think it helps I can also walk through this via a remote session.