Indigenuity
Indigenuity

Reputation: 9740

How to tell why Play 2.4 is shutting down

I have Play 2.4 app that I'm currently running in development mode that I would like to move to production. The one hitch is that every other day or so of running, it just shuts down with no reason given. The message in the logs:

2015-05-14 03:06:11 -0600 [INFO] from application in play-fork-run-akka.actor.default-dispatcher-22 - Application shutdown...

How can I get Play to give me a more specific message? This is pretty frustrating since it doesn't say anything else. There's no exception being thrown anywhere I can see, and I've been fairly thorough in logging errors.

For a bit of context, I'm running 3 Akka actor systems in the background, with 5-30 actors each. They send out some http traffic and a one system is involved with database querying.

Upvotes: 3

Views: 272

Answers (2)

bwawok
bwawok

Reputation: 15357

Let's see your Actor code? Can you trim it down for demo purposes?

I do something like this in my actor main loop. it very clearly logs if my actor blew up or not. If it did blow up, I know exactly why.

 private def doWork(workSender: ActorRef, work: Work): Unit = {

      work.doWork().onComplete {
        case Success(res) =>
          log.debug("Success during doWork on {}", work)
          self ! WorkComplete(WorkStatus.Success)
        case Failure(e) =>
          log.error(e, "Failure during doWork on {}", work)
          self ! WorkComplete(WorkStatus.Error)
      }
  }

Upvotes: 1

Leo
Leo

Reputation: 2199

I think I had pretty much the same problem couple of days ago. In my case I was able to find out in the stacktrace that actor system was shutting down die to NullPointerException.

In order to prevent JVM from shutting down you should add:

akka.jvm-exit-on-fatal-error = false
play.akka.jvm-exit-on-fatal-error = false

to your .conf file. I was not sure which string actually has an effect, so I've added both. It helped.

Upvotes: 3

Related Questions