Closed iskra-vitaly closed 11 years ago
@iskra-vitaly @ddevore +1 for creating the MongoDriver
with Some(context.system)
as argument.
But, since an ActorSystem
is always created and provided by an application (via EventsourcingExtension(system, ...)
) it is the application's responsibility to shutdown the provided ActorSystem
.
@iskra-vitaly @krasserm
Thanks Martin for pointing this out, so I'll leave the close close method as is. I'll make note of this in the Reactive journal readme that the application should shutdown its actor system when shutting down reactive.
@ddevore sounds good to me @iskra-vitaly do you see any issues to proceed as discussed and then closing the pull request? In any case, thanks you very much for your contribution.
I think it makes sense if the journal implementation would pass the actor system it's being run in to the MongoDriver. One more thing to mention - this day I discovered that several threads like reactive-dispatcher-* remain running in the JVM even after driver's actor system is properly shut down. This looks very strange - more like reactivemongo's or akka's bug. I'll try to investigate this issue deeper after weekend.
According to the source, askClose should shutdown the Reactive related actors on the host system, but I did find a thread where Stephane also recommends calling MongoDriver.close. I will add this to the journal close as well.
@ddevore only closing the MongoDriver in the journal stop should be sufficient (as it internally closes all created connections). It also covers what @iskra-vitaly tried to solve in his pull request.
@iskra-vitaly this issue should now be resolved with #124.
If the driver's actor system is not shut down it sometimes prevents application process from gracefull termination (even when sys.exit(0) is called) and causes thread leaks