qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milano Nicolum <dracz...@gmail.com>
Subject amqp.drainTimeout vs. jms.closeTimeout vs. jms.requestTimeout
Date Tue, 23 May 2017 14:55:30 GMT
Hi I have a question about function of different timeouts in Qpid JMS
client and priority they are applied in.

Currently I'm running Spring test using qpid-jms-client 0.23.0 (in
cooperation with spring-jms 4.3.8.RELEASE) to connect to MS Azure Service
Bus Queue, send a few messages there and confirm the same messages are
received by @JmsListener implementation from the Queue.

Message send + receive works fine, but when Spring tries to shut down
components at the end, the test gets stuck. The
org.springframework.jms.config.internalJmsListenerEndpointRegistry cannot
be shutdown in time because it is stuck waiting for a message.

I went through stacktrace and code and I got the impression the shutdown
getting stuck is caused by AmqpConsumer.pull(final long timeout, final
AsyncResult request) taking too long to finish.

My jms.closeTimeout is set to 1500ms, jms.requestTimeout to 500ms and
neither is applied on context shutdown. But when I tried setting
amqp.drainTimeout to 5000ms, the internal consumer times out on last drain
request, connection gets closed in time and all beans are destroyed OK.

As this is more of a workaround than a solution I wonder if there is a way
to shutdown the test correctly and more gracefully if possible. Is there
any way of interrupting pending drain requests manually? Shouldn't be the
jms.closeTimeout applied with higher priority than amqp.drainTimeout when
the connection is being closed?

Thanks for any information. At the moment the only information about these
settings I have is from
https://qpid.apache.org/releases/qpid-jms-0.23.0/docs/index.html and it is
simply not sufficient.

Stacktrace:
"DefaultMessageListenerContainer-1" #23 prio=5 os_prio=0
tid=0x0000000023db4000 nid=0x3a70 waiting on condition [0x0000000027a0e000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0x0000000773c2d328> (a
java.util.concurrent.CountDownLatch$Sync)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
    at
java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)
    at
java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:997)
    at
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1304)
    at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:231)
    at
org.apache.qpid.jms.provider.ProviderFuture.sync(ProviderFuture.java:97)
    at org.apache.qpid.jms.JmsConnection.pull(JmsConnection.java:829)
    at org.apache.qpid.jms.JmsConnection.pull(JmsConnection.java:818)
    at
org.apache.qpid.jms.JmsMessageConsumer.performPullIfRequired(JmsMessageConsumer.java:689)
    at
org.apache.qpid.jms.JmsMessageConsumer.dequeue(JmsMessageConsumer.java:283)
    at
org.apache.qpid.jms.JmsMessageConsumer.receive(JmsMessageConsumer.java:192)
    at
org.springframework.jms.connection.CachedMessageConsumer.receive(CachedMessageConsumer.java:82)
    at
org.springframework.jms.support.destination.JmsDestinationAccessor.receiveFromConsumer(JmsDestinationAccessor.java:130)
    at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveMessage(AbstractPollingMessageListenerContainer.java:416)
    at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:302)
    at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:255)
    at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1166)
    at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1158)
    at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1055)
    at java.lang.Thread.run(Thread.java:745)

"AmqpProvider:(1):[amqps://mySB.servicebus.windows.net:-1]" #18 daemon
prio=5 os_prio=0 tid=0x000000002388f800 nid=0x2664 waiting on condition
[0x0000000023a3e000]
   java.lang.Thread.State: TIMED_WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0x000000076fae3810> (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.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
    at
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
    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)

"QpidJMS Connection Executor: ID:4ac30ae5-f428-4f04-9512-f226aea41377:1"
#17 prio=5 os_prio=0 tid=0x0000000023ce0800 nid=0x3c24 waiting on condition
[0x0000000021d3e000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0x000000076fbb0d50> (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)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message