hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Problem with Shutting Down NIO HttpServer
Date Fri, 25 Sep 2015 07:46:12 GMT
On Thu, 2015-09-24 at 14:47 -0700, Hiranya Jayathilaka wrote:
> Hi Devs,
> I recently migrated an application from http-core to http-core-nio. When I try to gracefully
shutdown my server, I noticed that it does not terminate cleanly. It seems to hang. A thread
dump taken during this state revealed that the following thread is not getting killed:
> "HTTP-listener-8080-1" #11 prio=5 os_prio=31 tid=0x00007fc934887000 nid=0x6c03 waiting
on condition [0x0000000120c8d000]
>    java.lang.Thread.State: WAITING (parking)
> 	at sun.misc.Unsafe.park(Native Method)
> 	- parking to wait for  <0x000000076c0697e0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
> 	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
> 	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
> 	at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
> 	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> 	at java.lang.Thread.run(Thread.java:745)
> A close look at the source of HttpServer revealed that the listenerExecutorService used
by this class is never shut down. Incidentally, the classic blocking implementation of HttpServer
does call shutdown on the listenerExecutorService, and therefore the problem only occurs in
the nio version of the library.
> Is this a bug, or am I missing something? I'm using http-core-nio 4.4.3.

Yes, this looks like a bug. Please raise a JIRA for this defect.


To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org

View raw message