Play server constantly shuts down and reboots

(Aditya Athalye) #1

After upgrading play to 2.6.20, server shuts down after every few minutes and then restarts. See the logs below. All shutdown hooks get executed. Any idea what the cause could be?

2019-04-10 07:40:12,337 - [INFO] - [] [] [] - from play.core.server.AkkaHttpServer in Thread-25 Stopping server...
2019-04-10 07:40:12,394 - [INFO] - [] [] [] - from application in Thread-25 EventHandlerCache is shutting down
2019-04-10 07:40:12,394 - [INFO] - [] [] [] - from application in Thread-25 IncentiveCache is shutting down
2019-04-10 07:40:12,395 - [INFO] - [] [] [] - from application in Thread-25 DefaultEventCache: EventCache is shutting down
2019-04-10 07:40:12,395 - [INFO] - [] [] [] - from application in Thread-25 Shutting down messagebus consumer order
2019-04-10 07:40:12,395 - [INFO] - [] [] [] - from application in Thread-25 Shutdown of messagebus consumer order completed
2019-04-10 07:40:12,395 - [INFO] - [] [] [] - from application in Thread-25 Shutting down messagebus consumer incentiveUserPopulation
2019-04-10 07:40:12,395 - [INFO] - [] [] [] - from application in Thread-25 Shutdown of messagebus consumer incentiveUserPopulation completed
2019-04-10 07:40:12,395 - [INFO] - [] [] [] - from application in Thread-25 Shutting down the Cassandra client
2019-04-10 07:40:14,642 - [INFO] - [] [] [] - from application in Thread-25 Shutting down connection pool.
2019-04-10 07:40:14,644 - [INFO] - [] [] [] - from com.zaxxer.hikari.HikariDataSource in Thread-25 HikariPool-1 - Shutdown initiated...
2019-04-10 07:40:14,650 - [INFO] - [] [] [] - from com.zaxxer.hikari.HikariDataSource in Thread-25 HikariPool-1 - Shutdown completed.
2019-04-10 07:40:14,651 - [INFO] - [] [] [] - from application in Thread-25 Shutting down connection pool.
2019-04-10 07:40:14,651 - [INFO] - [] [] [] - from com.zaxxer.hikari.HikariDataSource in Thread-25 HikariPool-2 - Shutdown initiated...
2019-04-10 07:40:14,657 - [INFO] - [] [] [] - from com.zaxxer.hikari.HikariDataSource in Thread-25 HikariPool-2 - Shutdown completed.
2019-04-10 07:40:14,657 - [INFO] - [] [] [] - from application in Thread-25 Shutting down connection pool.
2019-04-10 07:40:14,657 - [INFO] - [] [] [] - from com.zaxxer.hikari.HikariDataSource in Thread-25 HikariPool-3 - Shutdown initiated...
2019-04-10 07:40:14,659 - [INFO] - [] [] [] - from com.zaxxer.hikari.HikariDataSource in Thread-25 HikariPool-3 - Shutdown completed.
2019-04-10 07:40:17,201 - [WARN] - [] [] [] - from application in main Logger configuration in conf files is deprecated and has no effect. Use a logback configuration file instead.
2019-04-10 07:40:17,689 - [WARN] - [] [] [] - from com.google.inject.assistedinject.AssistedInject in main AssistedInject factory businessmodels.event.populators.cassandra.DelayedUserIncentivePopulatorFactory will be slow because class businessmodels.event.populators.cassandra.DelayedUserIncentivePopulator has assisted Provider dependencies or injects the Injector. Stop injecting @Assisted Provider<T> (instead use @Assisted T) or Injector to speed things up. (It will be a ~6500% speed bump!)  The exact offending deps are: [Key[type=com.google.inject.Injector, annotation=[none]]@businessmodels.event.populators.cassandra.DelayedUserIncentivePopulator.<init>()[3]]
2019-04-10 07:40:17,692 - [WARN] - [] [] [] - from com.google.inject.assistedinject.AssistedInject in main AssistedInject factory businessmodels.event.depopulator.DelayedUserIncentiveDepopulatorFactory will be slow because class businessmodels.event.depopulator.DelayedUserIncentiveDepopulator has assisted Provider dependencies or injects the Injector. Stop injecting @Assisted Provider<T> (instead use @Assisted T) or Injector to speed things up. (It will be a ~6500% speed bump!)  The exact offending deps are: [Key[type=com.google.inject.Injector, annotation=[none]]@businessmodels.event.depopulator.DelayedUserIncentiveDepopulator.<init>()[2]]
2019-04-10 07:40:17,698 - [WARN] - [] [] [] - from com.google.inject.assistedinject.AssistedInject in main AssistedInject factory operations.incentive.factory.AddIncentiveTestAccountOperationFactory will be slow because class operations.incentive.AddIncentiveTestAccountOperation has assisted Provider dependencies or injects the Injector. Stop injecting @Assisted Provider<T> (instead use @Assisted T) or Injector to speed things up. (It will be a ~6500% speed bump!)  The exact offending deps are: [Key[type=com.google.inject.Injector, annotation=[none]]@operations.incentive.AddIncentiveTestAccountOperation.<init>()[2]]
2019-04-10 07:40:18,932 - [INFO] - [] [] [] - from akka.event.slf4j.Slf4jLogger in application-akka.actor.default-dispatcher-2 Slf4jLogger started
(Aditya Athalye) #2

Shutdown hooks are getting executed. Here is the stack trace.

at play.api.inject.ApplicationLifecycle.$anonfun$addStopHook$1(ApplicationLifecycle.scala:68)
	at scala.util.Try$.apply(Try.scala:209)
	at play.api.inject.DefaultApplicationLifecycle.$anonfun$stop$1(ApplicationLifecycle.scala:106)
	at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:303)
	at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:37)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
	at play.api.libs.streams.Execution$trampoline$.execute(Execution.scala:70)
	at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:68)
	at scala.concurrent.impl.Promise$KeptPromise$Kept.onComplete(Promise.scala:368)
	at scala.concurrent.impl.Promise$KeptPromise$Kept.onComplete$(Promise.scala:367)
	at scala.concurrent.impl.Promise$KeptPromise$Successful.onComplete(Promise.scala:375)
	at scala.concurrent.impl.Promise.transformWith(Promise.scala:36)
	at scala.concurrent.impl.Promise.transformWith$(Promise.scala:34)
	at scala.concurrent.impl.Promise$KeptPromise$Successful.transformWith(Promise.scala:375)
	at scala.concurrent.Future.flatMap(Future.scala:302)
	at scala.concurrent.Future.flatMap$(Future.scala:302)
	at scala.concurrent.impl.Promise$KeptPromise$Successful.flatMap(Promise.scala:375)
	at play.api.inject.DefaultApplicationLifecycle.clearHooks$1(ApplicationLifecycle.scala:105)
	at play.api.inject.DefaultApplicationLifecycle.stop(ApplicationLifecycle.scala:117)
	at play.api.DefaultApplication.stop(Application.scala:250)
	at play.api.Play$.$anonfun$stop$1(Play.scala:145)
	at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
	at play.api.Play$.stop(Play.scala:145)
	at play.core.server.AkkaHttpServer.$anonfun$stop$4(AkkaHttpServer.scala:394)
	at play.core.server.AkkaHttpServer.$anonfun$stop$4$adapted(AkkaHttpServer.scala:394)
	at scala.util.Success.foreach(Try.scala:249)
	at play.core.server.AkkaHttpServer.stop(AkkaHttpServer.scala:394)
	at play.core.server.ProdServerStart$.$anonfun$start$1(ProdServerStart.scala:59)
	at play.core.server.RealServerProcess$$anon$1.run(ServerProcess.scala:44)