Application doesn't terminate after execution.

427 views
Skip to first unread message

Jonathan Ferguson

unread,
Sep 20, 2013, 5:48:17 AM9/20/13
to dispatc...@googlegroups.com
Hello, 

I have a project using dispatch 0.11.0, Scala 2.10.0, sbt 0.13.0 and JDK 1.7 which is running as expected, however it will not terminate. jstack shows several resources belonging to Netty remaining open. 

A simple project to replicate the problem can be found at https://github.com/jonoabroad/dispatch-non-termination.
 
Any pointers would be greatly appreciated. 

Thank you 

Jono 

Jonathan Moore

unread,
Apr 18, 2014, 8:56:37 AM4/18/14
to dispatc...@googlegroups.com
I have seen the same behavior with my code as well.
A thread dump shows:

"ForkJoinPool-2-worker-11@2409" daemon prio=5 tid=0x27 nid=NA waiting
  java.lang.Thread.State: WAITING
 at sun.misc.Unsafe.park(Unsafe.java:-1)
 at scala.concurrent.forkjoin.ForkJoinPool.scan(ForkJoinPool.java:2075)
 at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
 at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

When I remove the line:
    val request = Http(url(quoteUrl) OK as.String)
Then the program terminates normally.

Any ideas what's causing this?

Luis Ángel Vicente Sánchez

unread,
Apr 18, 2014, 9:00:51 AM4/18/14
to dispatc...@googlegroups.com

You have to call Http.shutdown to close all threads, if not the application will not stop.

--
You received this message because you are subscribed to the Google Groups "Dispatch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dispatch-scal...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jonathan Moore

unread,
Apr 19, 2014, 12:44:16 AM4/19/14
to dispatc...@googlegroups.com
That works, thanks!
You received this message because you are subscribed to a topic in the Google Groups "Dispatch" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dispatch-scala/uyaN09otHoU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dispatch-scal...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages