Error with slick after switching from "jdbc.defaults.slick.driver" to "jdbc.defaults.slick.profile"

717 views
Skip to first unread message

Jason O'Conal

unread,
Feb 7, 2018, 8:29:17 AM2/7/18
to Lagom Framework Users
I've upgraded from Lagom 1.3.9 to Lagom 1.4.0 and changed

jdbc-defaults.slick.driver = "slick.driver.MySQLDriver$"

to

jdbc-defaults.slick.profile = "slick.jdbc.MySQLProfile$"

Now I am getting quite a few of these errors:

java.util.concurrent.RejectedExecutionException: Task slick.basic.BasicBackend$DatabaseDef$$anon$3@5538257 rejected from slick.util.AsyncExecutor$$anon$2$$anon$1@276e233[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 6256]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1379)
at slick.util.AsyncExecutor$$anon$2$$anon$3.execute(AsyncExecutor.scala:118)
at slick.basic.BasicBackend$DatabaseDef$class.scheduleSynchronousStreaming(BasicBackend.scala:267)
at slick.jdbc.JdbcBackend$DatabaseDef.scheduleSynchronousStreaming(JdbcBackend.scala:37)
at slick.basic.BasicBackend$DatabaseDef$class.streamSynchronousDatabaseAction(BasicBackend.scala:261)
at slick.jdbc.JdbcBackend$DatabaseDef.streamSynchronousDatabaseAction(JdbcBackend.scala:37)
at slick.basic.BasicBackend$DatabaseDef$class.runInContext(BasicBackend.scala:206)
at slick.jdbc.JdbcBackend$DatabaseDef.runInContext(JdbcBackend.scala:37)
at slick.basic.BasicBackend$DatabaseDef$$anon$1.subscribe(BasicBackend.scala:117)
at akka.stream.impl.fusing.ActorGraphInterpreter$BatchingActorInputBoundary.preStart(ActorGraphInterpreter.scala:116)
at akka.stream.impl.fusing.GraphInterpreter.init(GraphInterpreter.scala:293)
at akka.stream.impl.fusing.GraphInterpreterShell.init(ActorGraphInterpreter.scala:554)
at akka.stream.impl.fusing.ActorGraphInterpreter.tryInit(ActorGraphInterpreter.scala:676)
at akka.stream.impl.fusing.ActorGraphInterpreter.preStart(ActorGraphInterpreter.scala:724)
at akka.actor.Actor$class.aroundPreStart(Actor.scala:528)
at akka.stream.impl.fusing.ActorGraphInterpreter.aroundPreStart(ActorGraphInterpreter.scala:667)
at akka.actor.ActorCell.create(ActorCell.scala:591)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:462)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:484)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:282)
at akka.dispatch.Mailbox.run(Mailbox.scala:223)
at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

I've done a bit of googling, but haven't come up with any concrete solutions. I'll revert back to using "jdbc-defaults.slick.driver" for the time being, but I'd like to understand what's going on.

Renato Cavalcanti

unread,
Feb 7, 2018, 8:58:46 AM2/7/18
to Lagom Framework Users
Hi Jason,

That's probably not because of switching from driver to profile. Can you send here your full configuration?

Thanks
--
You received this message because you are subscribed to the Google Groups "Lagom Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lagom-framewo...@googlegroups.com.
To post to this group, send email to lagom-f...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lagom-framework/6f786c5e-ef7f-43a6-b30a-631e8f301838%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jason O'Conal

unread,
Feb 7, 2018, 5:39:28 PM2/7/18
to Lagom Framework Users
Full application.conf:

akka {
  actor.serialization-bindings {
    "akka.Done" = akka-misc
  }
  cluster.sharding.state-store-mode = ddata
}

db.default {
  driver = "com.mysql.cj.jdbc.Driver"
  url = ${DB_URL}
  username = ${DB_USER}
  password = ${DB_PASS}
}

lagom {
  cluster.join-self = true
  logger.includeConfigProperties = true
  persistence {
    ask-timeout = 20s
    jdbc.create-tables.auto = true
    passivate-after-idle-timeout = 60s
    snapshot-after = 5
  }
}

jdbc-defaults.slick.driver = "slick.driver.MySQLDriver$"

Jason O'Conal

unread,
Feb 7, 2018, 5:40:08 PM2/7/18
to Lagom Framework Users
Just realised I left in the old driver line, but the only change is to change it to profile as I mentioned in the original post.

Jason O'Conal

unread,
Feb 7, 2018, 5:52:43 PM2/7/18
to Lagom Framework Users
I'm also getting the following warning at times when using the driver configuration:

2018/02/07 22:50:19 WARN slick.basic.BasicBackend.stream [test] [] - Error scheduling synchronous streaming
java.util.concurrent.RejectedExecutionException: Task slick.basic.BasicBackend$DatabaseDef$$anon$3@e1d3324 rejected from slick.util.AsyncExecutor$$anon$2$$anon$1@399add12[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 2676]
On Thursday, 8 February 2018 00:28:46 UTC+10:30, Renato Cavalcanti wrote:

Tim Moore

unread,
Feb 8, 2018, 4:32:04 AM2/8/18
to Jason O'Conal, Lagom Framework Users
Jason,

Are there earlier errors in the logs? Those messages indicate an attempt to use a terminated database definition. I think the most likely explanation is that it failed to start in the first place. What's the first error that you see after starting the service?

Best,
Tim Moore

To unsubscribe from this group and stop receiving emails from it, send an email to lagom-framework+unsubscribe@googlegroups.com.
To post to this group, send email to lagom-framework@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lagom-framework/797ddc79-e253-43a0-a4aa-063b217c87af%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Tim Moore
Lagom Tech Lead, Lightbend, Inc.

Jason O'Conal

unread,
Feb 9, 2018, 4:19:01 PM2/9/18
to Tim Moore, Lagom Framework Users
Tim,

Thanks for your response. Looks like we were running out of connections in the pool or something similar. The issue is resolved now.


Jason
Reply all
Reply to author
Forward
0 new messages