qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robbie Gemmell <robbie.gemm...@gmail.com>
Subject Re: How to shutdown ack-flusher thread on Java client?
Date Thu, 11 Jun 2015 09:32:52 GMT
Since they are distinct clients and will likely exist concurrently for
some time (since they use different AMQP protocol versions, and there
is an installed user base of the earlier client), I would suggest
rasing JIRAs against both (using the QPID issue key for qpid-client,
and QPIDJMS key for qpid-jms-client).

I'm not sure what you are are seeing keep running with the new client,
but taking a quick peek at the exec plugin docs suggests you might be
able to connfigure it to avoid the issue with the older client, e.g
implementing an alternative kill strategy to avoid things running on
rather than trying to wait for a Thread that wont keep the JVM
running. It seems to be a long-known issue with regards to Timer, the
docs even links to a JDK bug filing for it (that wont be fixed since
it is a breaking change).

Robbie

On 11 June 2015 at 10:15, Tomohisa Igarashi <tm.igarashi@gmail.com> wrote:
> Hi Rob,
>
> Thank you for the immediate and clear response!
>
> I agree it doesn't cause a functional problem, just a cleanup issue on
> client shutdown.
> I just found qpid-jms-client and it looks like a successor of the one
> in qpid-client. Are you OK with filing a JIRA for this issue on
> QPIDJMS?
> (I also tried with qpid-jms-client 0.2.0 and same result)
>
> Thanks,
> Tomo
>
>
> --
> IGARASHI Tomohisa    mailto:tm.igarashi@gmail.com
>
>
> On Thu, Jun 11, 2015 at 4:48 PM, Rob Godfrey <rob.j.godfrey@gmail.com> wrote:
>> Hi Tomo,
>>
>> looking at the code (AMQSession_0_10.java), it seems that the
>> ack-flusher is created here (line 75):
>>
>> private static Timer timer = new Timer("ack-flusher", true);
>>
>> That is a single (java.util.)Timer is shared across all sessions on
>> *all* connections - the timer is not connection specific.  Since it is
>> shared by all connections, it is not cancel()led when a connection is
>> close()ed.  The Timer is created with isDaemon being true, so the fact
>> that the thread is never stopped wouldn't normally be an issue.
>>
>> It would need a code change on our side to change this behaviour.
>>
>> -- Rob
>>
>> On 11 June 2015 at 09:30, Tomohisa Igarashi <tm.igarashi@gmail.com> wrote:
>>> Hi,
>>>
>>> When I run Qpid Java client from exec-maven-plugin, I get this warning
>>> complaining about remaining ack-flusher thread:
>>>
>>> ===================
>>> [WARNING] thread
>>> Thread[ack-flusher,5,org.switchyard.quickstarts.camel.amqp.binding.QpidClient]
>>> was interrupted but is still alive after waiting at least 15000msecs
>>> [WARNING] thread
>>> Thread[ack-flusher,5,org.switchyard.quickstarts.camel.amqp.binding.QpidClient]
>>> will linger despite being asked to die via interruption
>>> [WARNING] NOTE: 1 thread(s) did not finish despite being asked to  via
>>> interruption. This is not a problem with exec:java, it is a problem
>>> with the running code. Although not serious, it should be remedied.
>>> [WARNING] Couldn't destroy threadgroup
>>> org.codehaus.mojo.exec.ExecJavaMojo$IsolatedThreadGroup[name=org.switchyard.quickstarts.camel.amqp.binding.QpidClient,maxpri=10]
>>> java.lang.IllegalThreadStateException
>>> ===================
>>>
>>> So ack-flusher thread is not stopped even after connection is closed.
>>> Is there a way to stop it safely?
>>>
>>> Whole client code is here:
>>> https://github.com/igarashitm/switchyard/blob/master/quickstarts/camel-amqp-binding/src/test/java/org/switchyard/quickstarts/camel/amqp/binding/QpidClient.java
>>>
>>> I tried adding connection.close() on this code with qpid-client 0.32,
>>> but I got same warning.
>>>
>>> Thanks,
>>> Tomo
>>>
>>> --
>>> IGARASHI Tomohisa    mailto:tm.igarashi@gmail.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
>>> For additional commands, e-mail: users-help@qpid.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
>> For additional commands, e-mail: users-help@qpid.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Mime
View raw message