Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play Framework 2.3.x scala - Application shutdown without exception

I have a play framework 2.3 application. When I deploy it my local machine in dev or production mode it works perfectly fine. However, when I deploy in a different server (Red Hat Enterprise Linux Server release 6.2, Santiago), after around 2 hours the application shuts down.
After profiling the application several times, I concluded that there aren't memory issues, deadlocks, etc. Everything is normal. I'm overriding the onStop method from GlobalSettings and logging a message like this:

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

and in the logs this is all what I see before the shutdown:

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

For some reason, it always come from Thread-4. I have the log in DEBUG level and I don't see any exceptions or messages that could raise any red flag. It seems that something is killing the application or sending a signal to stop. I have not been able to determine the reason of this shutdown. There isn't anything being logged to /var/log/messages or any other log besides the one of my application. Any ideas that could lead me to understand why the application stops?

Some details of my application: It is very simple, it exposes a REST API. I'm building a binary file and all its dependencies using the 'dist' command. I start it this way:

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

Thank you.

like image 805
j_alc Avatar asked May 21 '26 02:05

j_alc


1 Answers

There's an known issue providing java opts via -J parameter. Try JAVA_OPTS="-Xmx32g" ./activator instead. After doing this, check your running process list to approve if the java opts are really there.

like image 63
dr0i Avatar answered May 22 '26 14:05

dr0i



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!