You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@mina.apache.org by "Simo Chiegang, Boris Arthur" <Bo...@heidelberg.com> on 2016/06/24 08:50:49 UTC
Acceptor dispose block indefinitely
I Guys,
I have a server and I called to stop the server:
Acceptor.dispose(true);
But the call never come back. I don't know why:
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000f94bcd30> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
at java.util.concurrent.ThreadPoolExecutor.awaitTermination(ThreadPoolExecutor.java:1465)
at org.apache.mina.core.service.AbstractIoService.dispose(AbstractIoService.java:307)
at com.heidelberg.lvis.printdevice.sub.samba3.simu.DummySamba3JsonRpcServer.stop(DummySamba3JsonRpcServer.java:203)
at test.heidelberg.lvis.printdevice.devices.TestUtilsSamba3.stopHardwareSimulation(TestUtilsSamba3.java:110)
at test.heidelberg.lvis.printdevice.devices.Samba3HeadTemperatureTest.tearDown(Samba3HeadTemperatureTest.java:58)
I thinks, it must sure that this blocking call come back. Can you tell me in which case this can indefinitely block?.
________________________________
Confidentiality note:
The information in this email and any attachment may contain confidential and proprietary information of Heidelberger Druckmaschinen AG and/or its affiliates and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you are hereby notified that any review, reliance or distribution by others or forwarding without express permission is strictly prohibited and may cause liability. In case you have received this message due to an error in transmission, we kindly ask you to notify the sender immediately and to delete this email and any attachment from your system.
Re: Acceptor dispose block indefinitely
Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 24/06/16 � 13:13, Simo Chiegang, Boris Arthur a �crit :
> Hi thanks for the answer.
> I understand but why the sessions didn't complete?, I want to understand in which case this can appears. I tried more time and sometime its works. The server stops really quickly. Must I call Session.close() before I dispose the acceptor?
A session can be closed for many reasons :
- becaus ethe application decided to shutdown it
- because the client decided to shutdown it
but there are cases where the session may remain opened for ever,
typically if teh client has pulled the plug. In this case, teh session
will be closed when teh TCP time out will occur (could be 2 h).
RE: Acceptor dispose block indefinitely
Posted by "Simo Chiegang, Boris Arthur" <Bo...@heidelberg.com>.
Hi thanks for the answer.
I understand but why the sessions didn't complete?, I want to understand in which case this can appears. I tried more time and sometime its works. The server stops really quickly. Must I call Session.close() before I dispose the acceptor?
-----Original Message-----
From: Emmanuel Lécharny [mailto:elecharny@gmail.com]
Sent: Friday, June 24, 2016 12:56 PM
To: users@mina.apache.org
Subject: Re: Acceptor dispose block indefinitely
Le 24/06/16 à 10:50, Simo Chiegang, Boris Arthur a écrit :
> I Guys,
>
> I have a server and I called to stop the server:
>
> Acceptor.dispose(true);
>
> But the call never come back. I don't know why:
>
> java.lang.Thread.State: TIMED_WAITING (parking)
> at sun.misc.Unsafe.park(Native Method)
> - parking to wait for <0x00000000f94bcd30> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
> at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
> at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
> at java.util.concurrent.ThreadPoolExecutor.awaitTermination(ThreadPoolExecutor.java:1465)
> at org.apache.mina.core.service.AbstractIoService.dispose(AbstractIoService.java:307)
> at com.heidelberg.lvis.printdevice.sub.samba3.simu.DummySamba3JsonRpcServer.stop(DummySamba3JsonRpcServer.java:203)
> at test.heidelberg.lvis.printdevice.devices.TestUtilsSamba3.stopHardwareSimulation(TestUtilsSamba3.java:110)
> at
> test.heidelberg.lvis.printdevice.devices.Samba3HeadTemperatureTest.tea
> rDown(Samba3HeadTemperatureTest.java:58)
>
> I thinks, it must sure that this blocking call come back. Can you tell me in which case this can indefinitely block?.
Because you have explicitely called for it. Passing 'true' tells the dispose to wait for all the sessions to complete :
"Releases any resources allocated by this service. Please note that this method might block as long as there are any sessions managed by this service. Warning : calling this method from a IoFutureListener with awaitTermination = true will probably lead to a deadlock."
Pass 'false'.
________________________________
Confidentiality note:
The information in this email and any attachment may contain confidential and proprietary information of Heidelberger Druckmaschinen AG and/or its affiliates and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you are hereby notified that any review, reliance or distribution by others or forwarding without express permission is strictly prohibited and may cause liability. In case you have received this message due to an error in transmission, we kindly ask you to notify the sender immediately and to delete this email and any attachment from your system.
Re: Acceptor dispose block indefinitely
Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 24/06/16 � 10:50, Simo Chiegang, Boris Arthur a �crit :
> I Guys,
>
> I have a server and I called to stop the server:
>
> Acceptor.dispose(true);
>
> But the call never come back. I don't know why:
>
> java.lang.Thread.State: TIMED_WAITING (parking)
> at sun.misc.Unsafe.park(Native Method)
> - parking to wait for <0x00000000f94bcd30> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
> at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
> at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
> at java.util.concurrent.ThreadPoolExecutor.awaitTermination(ThreadPoolExecutor.java:1465)
> at org.apache.mina.core.service.AbstractIoService.dispose(AbstractIoService.java:307)
> at com.heidelberg.lvis.printdevice.sub.samba3.simu.DummySamba3JsonRpcServer.stop(DummySamba3JsonRpcServer.java:203)
> at test.heidelberg.lvis.printdevice.devices.TestUtilsSamba3.stopHardwareSimulation(TestUtilsSamba3.java:110)
> at test.heidelberg.lvis.printdevice.devices.Samba3HeadTemperatureTest.tearDown(Samba3HeadTemperatureTest.java:58)
>
> I thinks, it must sure that this blocking call come back. Can you tell me in which case this can indefinitely block?.
Because you have explicitely called for it. Passing 'true' tells the
dispose to wait for all the sessions to complete :
"Releases any resources allocated by this service. Please note that this
method might block as long as there are any sessions managed by this
service. Warning : calling this method from a IoFutureListener with
awaitTermination = true will probably lead to a deadlock."
Pass 'false'.
Re: Acceptor dispose block indefinitely
Posted by Guy Itzhaki <Gu...@nextnine.com>.
I experienced the same with Mina 2.0.9.
When I delve deeper into mina code I saw that the thread is looping endless until the sessions' collection is empty. And due to synchronization issue I guess it never does...
It was a long time ago and I'm not in front of my laptop right now so I cannot share more light.
Regards
Guy
Sent from iPhone, please excuse typos.
On 24 ????? 2016, at 11:51, Simo Chiegang, Boris Arthur <Bo...@heidelberg.com>> wrote:
I Guys,
I have a server and I called to stop the server:
Acceptor.dispose(true);
But the call never come back. I don't know why:
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000f94bcd30> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
at java.util.concurrent.ThreadPoolExecutor.awaitTermination(ThreadPoolExecutor.java:1465)
at org.apache.mina.core.service.AbstractIoService.dispose(AbstractIoService.java:307)
at com.heidelberg.lvis.printdevice.sub.samba3.simu.DummySamba3JsonRpcServer.stop(DummySamba3JsonRpcServer.java:203)
at test.heidelberg.lvis.printdevice.devices.TestUtilsSamba3.stopHardwareSimulation(TestUtilsSamba3.java:110)
at test.heidelberg.lvis.printdevice.devices.Samba3HeadTemperatureTest.tearDown(Samba3HeadTemperatureTest.java:58)
I thinks, it must sure that this blocking call come back. Can you tell me in which case this can indefinitely block?.
________________________________
Confidentiality note:
The information in this email and any attachment may contain confidential and proprietary information of Heidelberger Druckmaschinen AG and/or its affiliates and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you are hereby notified that any review, reliance or distribution by others or forwarding without express permission is strictly prohibited and may cause liability. In case you have received this message due to an error in transmission, we kindly ask you to notify the sender immediately and to delete this email and any attachment from your system.