Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More accurate dead letter count #235

Closed
drewhk opened this issue Oct 16, 2015 · 2 comments
Closed

More accurate dead letter count #235

drewhk opened this issue Oct 16, 2015 · 2 comments
Milestone

Comments

@drewhk
Copy link

drewhk commented Oct 16, 2015

The line here in UnboundedMeteredMailbox (https://github.com/Netflix/atlas/blob/master/atlas-akka/src/main/scala/com/netflix/atlas/akka/UnboundedMeteredMailbox.scala#L64)

 def cleanUp(owner: ActorRef, deadLetters: MessageQueue): Unit = {
    deadLettersCounter.increment(queue.size)
    queue.clear()
  }

attempts to count dead letters, but it will only record those that were already in the mailbox when the actor stops. Dead letters may arrive later than this point because either their enqueueing was in race with the shutdown, or because some actors are still sending messages to the reference after termination. In fact this latter is usually more important to record, since if an actor does not properly watch another, then the counter will increase monotonically, which the current implementation does not track (at leas as far as I see).

You can tap directly onto the dead letters as described here, maybe that is a better approach:

http://doc.akka.io/docs/akka/2.4.0/scala/event-bus.html#Dead_Letters

@brharrington
Copy link
Contributor

Thanks for the report. I'll try out your suggestions when I get a chance.

@brharrington brharrington added this to the 1.5.0 milestone Oct 16, 2015
brharrington added a commit that referenced this issue Oct 26, 2015
fix #235 monitor dead letters via event stream
@drewhk
Copy link
Author

drewhk commented Oct 27, 2015

thanks, solution looks good. Happy Hakking :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants