Bug 698657 - Java Spout hangs while sending more messages than allowed by qpid.max_count
Summary: Java Spout hangs while sending more messages than allowed by qpid.max_count
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-java
Version: Development
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: messaging-bugs
QA Contact: Messaging QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-21 13:37 UTC by Petr Matousek
Modified: 2024-01-19 19:11 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-16 21:26:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Apache JIRA QPID-3259 0 None None None Never
Red Hat Bugzilla 958031 1 None None None 2021-01-20 06:05:38 UTC

Internal Links: 958031

Description Petr Matousek 2011-04-21 13:37:00 UTC
Description of problem:

Java Spout hangs while sending more messages to a queue than allowed by qpid.max_count argument. The program do not finish even if the queue is emptied with Drain. The policy exceeded exception is raised by other clients (c++, python..).

Version-Release number of selected component (if applicable):
qpid-java-example-0.10-2.el5
qpid-java-common-0.10-2.el5
qpid-java-client-0.10-2.el5

How reproducible:
100%

Steps to Reproduce:
1. ./run_example.sh org.apache.qpid.example.Spout -c 3 "q; {create: always, node: {x-declare:{arguments:{'qpid.max_count': 2}}}}"
  
Actual results:
Java sender hang

Expected results:
Java sender ends with Policy exceeded exception 

Additional info:

# pstack 30910

Thread 12 (Thread 0xb7f62b90 (LWP 30911)):
#0  0x00dd1402 in __kernel_vsyscall ()
#1  0x00303ef2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x00634d42 in ?? () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#3  0x085b7840 in ?? ()
#4  0x085b7828 in ?? ()
#5  0xb7f61d14 in ?? ()
#6  0x085b7828 in ?? ()
#7  0x085b7820 in ?? ()
#8  0x000003e8 in ?? ()
#9  0x000078bf in ?? ()
#10 0x00788f50 in geteuid () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#11 0x085b7828 in ?? ()
#12 0x085b7840 in ?? ()
#13 0xb7f61d2c in ?? ()
#14 0x00634ef3 in ?? () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#15 0x085b7840 in ?? ()
#16 0x085b7828 in ?? ()
#17 0xb7f61d14 in ?? ()
#18 0xffffffff in ?? ()
#19 0x005851fe in JVM_FillInStackTrace () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
Thread 11 (Thread 0x93d33b90 (LWP 30912)):
#0  0x00dd1402 in __kernel_vsyscall ()
#1  0x00303ef2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x00634d42 in ?? () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#3  0x08609c40 in ?? ()
#4  0x08609c28 in ?? ()
#5  0x93d32f50 in ?? ()
#6  0x08609c28 in ?? ()
#7  0x08609c20 in ?? ()
#8  0x000003e8 in ?? ()
#9  0x000078c0 in ?? ()
#10 0x00788f50 in geteuid () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#11 0x08609c28 in ?? ()
#12 0x08609c40 in ?? ()
#13 0x93d32f68 in ?? ()
#14 0x00634ef3 in ?? () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#15 0x08609c40 in ?? ()
#16 0x08609c28 in ?? ()
#17 0x93d32f50 in ?? ()
#18 0xffffffff in ?? ()
#19 0x08609c00 in ?? ()
#20 0x085b54d8 in ?? ()
#21 0x000003e8 in ?? ()
#22 0x00000000 in ?? ()
Thread 10 (Thread 0x93cb2b90 (LWP 30913)):
#0  0x00dd1402 in __kernel_vsyscall ()
#1  0x00303bc5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x0063413e in ?? () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#3  0x0860e140 in ?? ()
#4  0x0860e128 in ?? ()
#5  0xffffffff in ?? ()
#6  0xffffffff in ?? ()
#7  0x0860d400 in ?? ()
#8  0x00000000 in ?? ()
Thread 9 (Thread 0x93c61b90 (LWP 30914)):
#0  0x00dd1402 in __kernel_vsyscall ()
#1  0x00303bc5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x0063413e in ?? () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#3  0x0860f940 in ?? ()
#4  0x0860f928 in ?? ()
#5  0xffffffff in ?? ()
#6  0xffffffff in ?? ()
#7  0x0860ec00 in ?? ()
#8  0x00000000 in ?? ()
Thread 8 (Thread 0x93a10b90 (LWP 30915)):
#0  0x00dd1402 in __kernel_vsyscall ()
#1  0x00305e45 in sem_wait@@GLIBC_2.1 () from /lib/libpthread.so.0
#2  0x00636a4a in ?? () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#3  0x0079bca8 in geteuid () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#4  0x00201c81 in _int_malloc () from /lib/libc.so.6
#5  0x0062f985 in ?? () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#6  0x00774088 in geteuid () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#7  0x93a10060 in ?? ()
#8  0x00000000 in ?? ()
Thread 7 (Thread 0x939bfb90 (LWP 30916)):
#0  0x00dd1402 in __kernel_vsyscall ()
#1  0x00303bc5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x0063413e in ?? () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#3  0x08624a40 in ?? ()
#4  0x08624a28 in ?? ()
#5  0xffffffff in ?? ()
#6  0xffffffff in ?? ()
#7  0xb3fe9880 in ?? ()
#8  0x00618e60 in ?? () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#9  0x939bf0d8 in ?? ()
#10 0x00788f50 in geteuid () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#11 0x08624a00 in ?? ()
#12 0x085b5d60 in ?? ()
#13 0x939bf108 in ?? ()
#14 0x00619a44 in ?? () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#15 0x08624a00 in ?? ()
#16 0x00000001 in ?? ()
#17 0x085b5d70 in ?? ()
#18 0x085b5d70 in ?? ()
#19 0x00000000 in ?? ()
Thread 6 (Thread 0x9393eb90 (LWP 30917)):
#0  0x00dd1402 in __kernel_vsyscall ()
#1  0x00303bc5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x0063413e in ?? () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#3  0x08627840 in ?? ()
#4  0x08627828 in ?? ()
#5  0xffffffff in ?? ()
#6  0xffffffff in ?? ()
#7  0x08626c00 in ?? ()
#8  0x085b4cb8 in ?? ()
#9  0x9393e0e8 in ?? ()
#10 0x00788f50 in geteuid () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#11 0x08627800 in ?? ()
#12 0x085b4cb8 in ?? ()
#13 0x9393e0f8 in ?? ()
#14 0x00619a44 in ?? () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#15 0x08627800 in ?? ()
#16 0x00000001 in ?? ()
#17 0x085b4cc8 in ?? ()
#18 0x085b4cc8 in ?? ()
#19 0x002ee170 in main_arena () from /lib/libc.so.6
#20 0x00000004 in ?? ()
#21 0x9393e208 in ?? ()
#22 0x085b4cc8 in ?? ()
#23 0x00000000 in ?? ()
Thread 5 (Thread 0x938edb90 (LWP 30918)):
#0  0x00dd1402 in __kernel_vsyscall ()
#1  0x00303ef2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x00634d42 in ?? () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#3  0x08629540 in ?? ()
#4  0x08629528 in ?? ()
#5  0x938ed290 in ?? ()
#6  0x08629528 in ?? ()
#7  0x08629520 in ?? ()
#8  0x00000032 in ?? ()
#9  0x000078c6 in ?? ()
#10 0x00788f50 in geteuid () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#11 0x08629528 in ?? ()
#12 0x08629540 in ?? ()
#13 0x938ed2a8 in ?? ()
#14 0x00634ef3 in ?? () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#15 0x08629540 in ?? ()
#16 0x08629528 in ?? ()
#17 0x938ed290 in ?? ()
#18 0xffffffff in ?? ()
#19 0x226c4b50 in ?? ()
#20 0x0004a070 in ?? ()
#21 0x00000032 in ?? ()
#22 0x00000000 in ?? ()
Thread 4 (Thread 0x93816b90 (LWP 30920)):
#0  0x00dd1402 in __kernel_vsyscall ()
#1  0x00303bc5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x0063413e in ?? () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#3  0x087bf340 in ?? ()
#4  0x087bf328 in ?? ()
#5  0xffffffff in ?? ()
#6  0xffffffff in ?? ()
#7  0x087b9000 in ?? ()
#8  0x00000000 in ?? ()
Thread 3 (Thread 0x937c5b90 (LWP 30921)):
#0  0x00dd1402 in __kernel_vsyscall ()
#1  0x00303ef2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x00634d42 in ?? () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#3  0x087c7c40 in ?? ()
#4  0x087c7c28 in ?? ()
#5  0x937c44b0 in ?? ()
#6  0x087c7c28 in ?? ()
#7  0x087c7c20 in ?? ()
#8  0x000003e8 in ?? ()
#9  0x000078c9 in ?? ()
#10 0x00788f50 in geteuid () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#11 0x087c7c28 in ?? ()
#12 0x087c7c40 in ?? ()
#13 0x937c44c8 in ?? ()
#14 0x00634ef3 in ?? () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#15 0x087c7c40 in ?? ()
#16 0x087c7c28 in ?? ()
#17 0x937c44b0 in ?? ()
#18 0xffffffff in ?? ()
#19 0x0045dde9 in geteuid () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#20 0x007743c8 in geteuid () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#21 0x000003e8 in ?? ()
#22 0x00000000 in ?? ()
Thread 2 (Thread 0x93774b90 (LWP 30922)):
#0  0x00dd1402 in __kernel_vsyscall ()
#1  0x00303bc5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x0063413e in ?? () from /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/libjvm.so
#3  0x087f5a40 in ?? ()
#4  0x087f5a28 in ?? ()
#5  0xffffffff in ?? ()
#6  0xffffffff in ?? ()
#7  0x087f5400 in ?? ()
#8  0x00000000 in ?? ()
Thread 1 (Thread 0xb7f636c0 (LWP 30910)):
#0  0x00dd1402 in __kernel_vsyscall ()
#1  0x00300a77 in pthread_join () from /lib/libpthread.so.0
#2  0x0804c9cd in ?? ()
#3  0xb7f62b90 in ?? ()
#4  0xbfd11924 in ?? ()
#5  0x08049ff0 in geteuid ()
#6  0xbfd149e8 in ?? ()
#7  0x002ecff4 in ?? () from /lib/libc.so.6
#8  0x00201ac1 in free () from /lib/libc.so.6
#9  0x0804bff8 in ?? ()
#10 0x08049ff0 in geteuid ()
#11 0x00050000 in ?? ()
#12 0x00000000 in ?? ()

Comment 1 Frantisek Reznicek 2011-04-22 12:47:57 UTC
Producer flow control was not triggered.

Comment 3 Gordon Sim 2011-04-26 11:26:33 UTC
This is due to deadlocking as a result of the exception handling:

2011-04-26 07:21:48
Full thread dump Java HotSpot(TM) Server VM (1.6.0_01-b06 mixed mode):

"Attach Listener" daemon prio=10 tid=0x08d84400 nid=0x7916 waiting on condition [0x00000000..0x00000000]
   java.lang.Thread.State: RUNNABLE

"ack-flusher" daemon prio=10 tid=0x08eddc00 nid=0x7904 in Object.wait() [0xafdad000..0xafdadf30]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0xeec118e8> (a java.util.TaskQueue)
	at java.lang.Object.wait(Object.java:485)
	at java.util.TimerThread.mainLoop(Timer.java:483)
	- locked <0xeec118e8> (a java.util.TaskQueue)
	at java.util.TimerThread.run(Timer.java:462)

"IoReceiver - localhost/127.0.0.1:5672" daemon prio=10 tid=0x08dae400 nid=0x7903 waiting for monitor entry [0xaff90000..0xaff90eb0]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.apache.qpid.client.AMQConnection.exceptionReceived(AMQConnection.java:1297)
	- waiting to lock <0xedddd2b8> (a java.lang.Object)
	at org.apache.qpid.client.AMQSession_0_10.setCurrentException(AMQSession_0_10.java:1033)
	- locked <0xeec73eb8> (a java.lang.Object)
	at org.apache.qpid.client.AMQSession_0_10.exception(AMQSession_0_10.java:913)
	at org.apache.qpid.transport.SessionDelegate.executionException(SessionDelegate.java:156)
	at org.apache.qpid.transport.SessionDelegate.executionException(SessionDelegate.java:32)
	at org.apache.qpid.transport.ExecutionException.dispatch(ExecutionException.java:112)
	at org.apache.qpid.transport.SessionDelegate.command(SessionDelegate.java:50)
	at org.apache.qpid.transport.SessionDelegate.command(SessionDelegate.java:32)
	at org.apache.qpid.transport.Method.delegate(Method.java:159)
	at org.apache.qpid.transport.Session.received(Session.java:497)
	at org.apache.qpid.transport.Connection.dispatch(Connection.java:403)
	at org.apache.qpid.transport.ConnectionDelegate.handle(ConnectionDelegate.java:64)
	at org.apache.qpid.transport.ConnectionDelegate.handle(ConnectionDelegate.java:40)
	at org.apache.qpid.transport.MethodDelegate.executionException(MethodDelegate.java:110)
	at org.apache.qpid.transport.ExecutionException.dispatch(ExecutionException.java:112)
	at org.apache.qpid.transport.ConnectionDelegate.command(ConnectionDelegate.java:54)
	at org.apache.qpid.transport.ConnectionDelegate.command(ConnectionDelegate.java:40)
	at org.apache.qpid.transport.Method.delegate(Method.java:159)
	at org.apache.qpid.transport.Connection.received(Connection.java:368)
	at org.apache.qpid.transport.Connection.received(Connection.java:58)
	at org.apache.qpid.transport.network.Assembler.emit(Assembler.java:95)
	at org.apache.qpid.transport.network.Assembler.assemble(Assembler.java:196)
	at org.apache.qpid.transport.network.Assembler.frame(Assembler.java:129)
	at org.apache.qpid.transport.network.Frame.delegate(Frame.java:133)
	at org.apache.qpid.transport.network.Assembler.received(Assembler.java:100)
	at org.apache.qpid.transport.network.Assembler.received(Assembler.java:42)
	at org.apache.qpid.transport.network.InputHandler.next(InputHandler.java:187)
	at org.apache.qpid.transport.network.InputHandler.received(InputHandler.java:103)
	at org.apache.qpid.transport.network.InputHandler.received(InputHandler.java:42)
	at org.apache.qpid.transport.network.io.IoReceiver.run(IoReceiver.java:128)
	at java.lang.Thread.run(Thread.java:619)

"IoSender - localhost/127.0.0.1:5672" daemon prio=10 tid=0x08cbe400 nid=0x7902 in Object.wait() [0xafdfe000..0xafdfee30]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0xee9e6f90> (a java.lang.Object)
	at java.lang.Object.wait(Object.java:485)
	at org.apache.qpid.transport.network.io.IoSender.run(IoSender.java:247)
	- locked <0xee9e6f90> (a java.lang.Object)
	at java.lang.Thread.run(Thread.java:619)

"Low Memory Detector" daemon prio=10 tid=0xb0702400 nid=0x78ff runnable [0x00000000..0x00000000]
   java.lang.Thread.State: RUNNABLE

"CompilerThread1" daemon prio=10 tid=0xb0700800 nid=0x78fe waiting on condition [0x00000000..0xb015e5c8]
   java.lang.Thread.State: RUNNABLE

"CompilerThread0" daemon prio=10 tid=0x08c0fc00 nid=0x78fd waiting on condition [0x00000000..0xb01df548]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" daemon prio=10 tid=0x08c0e800 nid=0x78fc runnable [0x00000000..0xb0230c10]
   java.lang.Thread.State: RUNNABLE

"Finalizer" daemon prio=10 tid=0x08bfb800 nid=0x78fb in Object.wait() [0xb0481000..0xb0481eb0]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0xedc60b40> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
	- locked <0xedc60b40> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=10 tid=0x08bfb000 nid=0x78fa in Object.wait() [0xb04d2000..0xb04d2e30]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0xedc60a40> (a java.lang.ref.Reference$Lock)
	at java.lang.Object.wait(Object.java:485)
	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
	- locked <0xedc60a40> (a java.lang.ref.Reference$Lock)

"main" prio=10 tid=0x08b14400 nid=0x78f4 in Object.wait() [0xf7f92000..0xf7f93208]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0xeecabc38> (a [Lorg.apache.qpid.transport.Method;)
	at org.apache.qpid.transport.util.Waiter.await(Waiter.java:54)
	at org.apache.qpid.transport.Session.sync(Session.java:758)
	- locked <0xeecabc38> (a [Lorg.apache.qpid.transport.Method;)
	at org.apache.qpid.transport.Session.sync(Session.java:739)
	at org.apache.qpid.client.AMQSession_0_10.sendClose(AMQSession_0_10.java:391)
	at org.apache.qpid.client.AMQSession.close(AMQSession.java:742)
	- locked <0xeec6d958> (a java.lang.Object)
	- locked <0xedddd2b8> (a java.lang.Object)
	at org.apache.qpid.client.AMQSession.close(AMQSession.java:708)
	at org.apache.qpid.client.AMQSession.close(AMQSession.java:567)
	at org.apache.qpid.example.Spout.<init>(Spout.java:103)
	at org.apache.qpid.example.Spout.main(Spout.java:146)

"VM Thread" prio=10 tid=0x08bf8400 nid=0x78f9 runnable 

"GC task thread#0 (ParallelGC)" prio=10 tid=0x08b1b000 nid=0x78f5 runnable 

"GC task thread#1 (ParallelGC)" prio=10 tid=0x08b1c000 nid=0x78f6 runnable 

"GC task thread#2 (ParallelGC)" prio=10 tid=0x08b1d400 nid=0x78f7 runnable 

"GC task thread#3 (ParallelGC)" prio=10 tid=0x08b1e400 nid=0x78f8 runnable 

"VM Periodic Task Thread" prio=10 tid=0xb0704000 nid=0x7900 waiting on condition 

JNI global references: 978

main thread is waiting for ioreceiver, ioreceiver is blocked waiting for lock held by main thread. Fyi the above was on qpid-java-client-0.10-4.el5. On earlier version of the packages jstack detected deadlock as per bug 697913. May just be a timing issue which stack you actually get.

Comment 4 Rajith Attapattu 2011-05-16 21:26:25 UTC

*** This bug has been marked as a duplicate of bug 697913 ***

Comment 5 Rajith Attapattu 2011-05-16 21:35:01 UTC
All though the deadlock issue bug 697913 is resolved the Spout doesn't exit gracefully after printing the exception. It still gives the illusion that it's hung.

Therefore reopening the issue until Spout is properly fixed.

Comment 6 Rajith Attapattu 2011-05-19 21:09:20 UTC
Initially spout was hanging due to the deadlock covered by bug 697913.

However the subsequent issue (described in comment #3) is not really a deadlock, rather a temporary hang that gives the illusion of a deadlock. This is the same issue as QPID-3259. 

I have described the issue in detail here.
https://issues.apache.org/jira/browse/QPID-3259?focusedCommentId=13036452&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13036452

Similar to the issue in QPID-3259, if I leave Spout for a bit, it will eventually time out with an error that looks like the following.

Caused by: org.apache.qpid.AMQException: timed out waiting for sync: complete = 0, point = 4 [error code 541: internal error]

As mentioned in QPID-3259, this issue depends on a race condition. If the program calls session.close just before the client receives the execution exception then this issue comes into play.

If you introduce a delay for example by doing the following, you can see there is no hang.

Notice here, that the difference here is that you are sending 100 msgs instead of 3 before you quit the program (the quit routing contains the session close).

./run_example.sh org.apache.qpid.example.Spout -c 100 "q; {create: always,
node: {x-declare:{arguments:{'qpid.max_count': 2}}}}"

Comment 7 Justin Ross 2013-02-22 13:30:29 UTC
For me, this quacks like a deadlock.

Comment 12 Rajith Attapattu 2013-10-01 21:39:50 UTC
This is handled properly in the new client.

Please test using the Spout in the 0_10 package as follows.

java -cp $QP org.apache.qpid.amqp_0_10.example.Spout -c 3 "q; {create: always, node: {x-declare:{arguments:{'qpid.max_count': 2}}}}"

Comment 13 Irina Boverman 2013-10-03 20:39:34 UTC
VERIFIED:
---
 ./run_example.sh org.apache.qpid.example.Spout -c 3 "q; {create: always, node: {x-declare:{arguments:{'qpid.max_count': 2}}}}"
{c=3}
Sent 0 messages so far
Sent 3 messages in total

<---- 30 sec wait----->

main 2013-10-03 16:31:47,894 ERROR [apache.qpid.client.AMQConnection] Throwable Received but no listener set: org.apache.qpid.AMQException: timed out waiting for sync: complete = 2, point = 5 [error code 541: internal error]
Exception in thread "main" IoReceiver - localhost/127.0.0.1:5672 -2013-10-03 16:30:47.554 2013-10-03 16:31:47,895 ERROR [apache.qpid.client.AMQConnection] Throwable Received but no listener set: org.apache.qpid.AMQException: ch=0 id=1 ExecutionException(errorCode=RESOURCE_LIMIT_EXCEEDED, commandId=3, classCode=0, commandCode=0, fieldIndex=0, description=resource-limit-exceeded: resource-limit-exceeded: Maximum depth exceeded on q: current=[count: 2, size: 0], max=[count: 2, size: 104857600] (/builddir/build/BUILD/qpid-0.22/cpp/src/qpid/broker/Queue.cpp:1659), errorInfo={}) [error code 506: resource error]
javax.jms.JMSException: Error closing session: org.apache.qpid.AMQException: timed out waiting for sync: complete = 2, point = 5 [error code 541: internal error]
	at org.apache.qpid.client.AMQSession.close(AMQSession.java:720)
	at org.apache.qpid.client.AMQSession.close(AMQSession.java:682)
	at org.apache.qpid.client.AMQSession.close(AMQSession.java:534)
	at org.apache.qpid.example.Spout.<init>(Spout.java:109)
	at org.apache.qpid.example.Spout.main(Spout.java:152)
Caused by: org.apache.qpid.AMQException: timed out waiting for sync: complete = 2, point = 5 [error code 541: internal error]
	at org.apache.qpid.client.AMQSession_0_10.setCurrentException(AMQSession_0_10.java:1070)
	at org.apache.qpid.client.AMQSession_0_10.sendClose(AMQSession_0_10.java:431)
	at org.apache.qpid.client.AMQSession.close(AMQSession.java:714)
	... 4 more
-- 
Installed packages:

qpid-jca-0.22-1.el6.noarch
qpid-tools-0.22-5.el6.noarch
qpid-cpp-server-devel-0.22-18.el6.x86_64
qpid-cpp-client-devel-0.22-18.el6.x86_64
qpid-cpp-client-devel-docs-0.22-18.el6.noarch
qpid-java-client-0.23-1.el6.noarch
qpid-snmpd-1.0.0-12.el6.x86_64
perl-qpid-0.22-5.el6.x86_64
qpid-proton-c-0.5-6.el6.x86_64
qpid-cpp-client-0.22-18.el6.x86_64
qpid-cpp-client-ssl-0.22-18.el6.x86_64
qpid-cpp-server-store-0.22-18.el6.x86_64
qpid-java-example-0.23-1.el6.noarch
qpid-tests-0.22-5.el6.noarch
python-qpid-qmf-0.22-14.el6.x86_64
ruby-qpid-qmf-0.22-14.el6.x86_64
qpid-proton-c-devel-0.5-6.el6.x86_64
qpid-cpp-server-0.22-18.el6.x86_64
qpid-cpp-server-ssl-0.22-18.el6.x86_64
qpid-cpp-server-xml-0.22-18.el6.x86_64
qpid-jca-xarecovery-0.22-1.el6.noarch
qpid-cpp-client-rdma-0.22-18.el6.x86_64
qpid-cpp-server-ha-0.22-18.el6.x86_64
qpid-java-common-0.23-1.el6.noarch
qpid-qmf-0.22-14.el6.x86_64
qpid-qmf-devel-0.22-14.el6.x86_64
python-qpid-0.22-5.el6.noarch
qpid-cpp-server-rdma-0.22-18.el6.x86_64

However, there is a 30 sec wait after this:
Sent 3 messages in total
... and exception message.

In this acceptable?

Comment 18 Rajith Attapattu 2014-04-10 15:19:22 UTC
This issue was not fixed for the old client.
Irina had tested with the new client but that is no longer part of our product.

Most of these hangs are related to the core issues around threading. Given we are not going to fix it in the old client we should remove these bugs from the release.


Note You need to log in before you can comment on or make changes to this bug.