Play Framework 2.3.x scala - shutdown without exception

I have a play framework 2.3 application. When I use his local machine in dev or production mode, it works fine. However, when I deploy to another server (Red Hat Enterprise Linux Server version 6.2, Santiago), the application exits after about 2 hours.
After profiling the application several times, I came to the conclusion that there are no memory issues, deadlocks, etc. It's okay. I am overriding the onStop method from GlobalSettings and logging the message like this:

 override def onStop(app: Application) {
    Logger.info("Application is shutting shutdown...ByeBye")
  }

      

and in the logs this is all I see before disconnecting:

2015-05-27 00:36:54,515 - [INFO] - from application in **Thread-4** 
Application is shutting shutdown...ByeBye

      

For some reason, it always comes from Thread-4. I have a DEBUG level log and I don't see any exceptions or messages that could raise any red flag. It seems like something is killing the application or sending a signal to stop. I was unable to determine the reason for this disconnection. In one of my applications, nothing is written to / var / log / messages or any other log. Any ideas that might make me understand why the application is terminating?

Some details of my application: It's very simple, it provides a REST API. I am building a binary and all its dependencies using the "dist" command. I start like this:

/path/to/binary -Dhttp.port=5000  -J-Xmx32g -Dconfig.resource=application_prod.conf

      

Thank.

+3


source to share


3 answers


There is a known issue in there providing java opts via parameter-J

. Try it instead JAVA_OPTS="-Xmx32g" ./activator

. After that, check the list of running processes to assert if java variants actually exist.



+1


source


If you run the application from the terminal via ssh, after a while the ssh session may end and the application process will join the session.I got around this by running the start command via nohup so that the process is no longer interactive and dumps logs to the specified file instead of the terminal



0


source


Had a similar issue, apparently when running in debug mode (instead of a "run" command for production) it was used to shutdown without exception after 4 seconds. Switch to prod. the regime solved my problem.

0


source







All Articles