How do I avoid a bunch of dead letter messages on shutdown / how do I shutdown properly?

73 views
Skip to first unread message

John

unread,
Oct 7, 2016, 6:52:36 PM10/7/16
to ReactiveMongo - http://reactivemongo.org
Hello,

I'm using ReactiveMongo 0.11.14 with play2-reactivemongo 0.11.14 and playframework 2.5.8.  No matter how I go about shutting down ReactiveMongo, I get a bunch of dead-letter notices from akka.  The messages that aren't getting delivered relate to shutting down. (ChannelDisconnected and Close for example.)

Obviously I can just suppress the log messages, but the fact that I'm getting them makes me think I'm not doing something right.

How do I shut down cleanly?

One of the ways I've tried:

for
(connection <- reactiveMongoApi.driver.connections) { Await.ready(connection.askClose()(5.seconds), 5.seconds) //shut down sequentially just to keep things really simple for now } reactiveMongoApi.driver.close(5.seconds)


Sample of some of the dead letter messages:

[INFO] [10/07/2016 16:43:23.278] [reactivemongo-akka.actor.default-dispatcher-7] [akka://reactivemongo/user/Monitor-Connection-14] Message [reactivemongo.core.actors.Close$] from Actor[akka://reactivemongo/deadLetters] to Actor[akka://reactivemongo/user/Monitor-Connection-14#872222110] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[INFO] [10/07/2016 16:43:23.278] [reactivemongo-akka.actor.default-dispatcher-7] [akka://reactivemongo/user/Connection-14] Message [reactivemongo.core.actors.ChannelDisconnected] from Actor[akka://reactivemongo/deadLetters] to Actor[akka://reactivemongo/user/Connection-14#-1011500417] was not delivered. [2] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.

Thanks,

-John

Cédric Chantepie

unread,
Oct 7, 2016, 7:05:57 PM10/7/16
to ReactiveMongo - http://reactivemongo.org
You should not close the Play plugin, as it must be closed by the app lifecycle.
Reply all
Reply to author
Forward
0 new messages