Client applications hang after closing connections and sessions
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alex_Cruise
Posted On:   Thursday, March 6, 2003 07:23 PM

Hi there, I hope this isn't a newbie question, but we use some short-lived utilities that post a message to a queue then exit. Unfortunately, they seem to hang forever after closing their sessions and connections. Can you give me a hint as to what might be causing this behaviour? I'm concerned that something similar might be occurring in the production software that keeps more JMS connections open for longer. Thanks! Oddly enough, if I Ctrl-Z then 'bg' the app, it finally exits. I'm running this on J2SE 1.3.1_03-b03 on RH Linux with glibc 2.2.4-31 and I've tried the J2SE_PREEMPTCLOSE workaround, to no effect. Here's an example run with a thread dump from the period during which    More>>

Hi there,


I hope this isn't a newbie question, but we use some short-lived utilities that post a message to a queue then exit. Unfortunately, they seem to hang forever after closing their sessions and connections. Can you give me a hint as to what might be causing this behaviour? I'm concerned that something similar might be occurring in the production software that keeps more JMS connections open for longer.


Thanks!


Oddly enough, if I Ctrl-Z then 'bg' the app, it finally exits. I'm running this on J2SE 1.3.1_03-b03 on RH Linux with glibc 2.2.4-31 and I've tried the J2SE_PREEMPTCLOSE workaround, to no effect.


Here's an example run with a thread dump from the period during which it's hung:



[root@mercnotifier notifier]# ./ping.sh


mercury:queueaccess@smqp://localhost:4001/timeout=10000:0


Sent: 7,9,NewNotification


Closing topic publisher...


Closing queue sender...


Closing JMSInfo...


Closing queue session...


Closing queue connection...


Closing topic session...


Closing topic connection...



(I pressed Ctrl- at this point to SIGQUIT the app. Note that none of my code is still running! :)


Full thread dump:


"Thread-4" prio=1 tid=0x8111038 nid=0x3738 waiting on monitor [0..0xbfffd568]


"Thread-3" prio=1 tid=0x8117728 nid=0x376c runnable [0x4c2c9000..0x4c2c9870]
at java.net.SocketInputStream.socketRead(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:85)
at com.swiftmq.jms.ConnectionImpl.run(ConnectionImpl.java:448)
at java.lang.Thread.run(Thread.java:479)


"Thread-1" prio=1 tid=0x81289d8 nid=0x3769 runnable [0x4bec9000..0x4bec9870]
at java.net.SocketInputStream.socketRead(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:85)
at com.swiftmq.jms.ConnectionImpl.run(ConnectionImpl.java:448)
at java.lang.Thread.run(Thread.java:479)


"PoolExecutor" daemon prio=1 tid=0x8121530 nid=0x3766 waiting on monitor [0x4bcc9000..0x4bcc9870]
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:415)
at com.swiftmq.tools.thread.Threadpool.getNextTask(Threadpool.java:118)
at com.swiftmq.tools.thread.PoolExecutor.run(PoolExecutor.java:32)


"PoolExecutor" daemon prio=1 tid=0x810ca48 nid=0x3765 waiting on monitor [0x4bac9000..0x4bac9870]
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:415)
at com.swiftmq.tools.thread.Threadpool.getNextTask(Threadpool.java:118)
at com.swiftmq.tools.thread.PoolExecutor.run(PoolExecutor.java:46)


"PoolExecutor" daemon prio=1 tid=0x8123780 nid=0x3764 waiting on monitor [0x4b8c9000..0x4b8c9870]
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:415)
at com.swiftmq.tools.thread.Threadpool.getNextTask(Threadpool.java:118)
at com.swiftmq.tools.thread.PoolExecutor.run(PoolExecutor.java:46)


"PoolExecutor" daemon prio=1 tid=0x8122a30 nid=0x3763 waiting on monitor [0x4b6c9000..0x4b6c9870]
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:415)
at com.swiftmq.tools.thread.Threadpool.getNextTask(Threadpool.java:118)
at com.swiftmq.tools.thread.PoolExecutor.run(PoolExecutor.java:46)


"PoolExecutor" daemon prio=1 tid=0x8110d60 nid=0x3762 waiting on monitor [0x4b4c9000..0x4b4c9870]
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:415)
at com.swiftmq.tools.thread.Threadpool.getNextTask(Threadpool.java:118)
at com.swiftmq.tools.thread.PoolExecutor.run(PoolExecutor.java:46)


"Thread-0" prio=1 tid=0x809b000 nid=0x3761 runnable [0x4b2c9000..0x4b2c9870]
at java.net.SocketInputStream.socketRead(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:85)
at com.swiftmq.jms.ConnectionImpl.run(ConnectionImpl.java:448)
at java.lang.Thread.run(Thread.java:479)


"PoolExecutor" daemon prio=1 tid=0x810e7d0 nid=0x3760 waiting on monitor [0x4b0c9000..0x4b0c9870]
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:415)
at com.swiftmq.tools.thread.Threadpool.getNextTask(Threadpool.java:118)
at com.swiftmq.tools.thread.PoolExecutor.run(PoolExecutor.java:46)


"PoolExecutor" daemon prio=1 tid=0x809b5d8 nid=0x375f waiting on monitor [0x4aec9000..0x4aec9870]
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:415)
at com.swiftmq.tools.thread.Threadpool.getNextTask(Threadpool.java:118)
at com.swiftmq.tools.thread.PoolExecutor.run(PoolExecutor.java:46)


"PoolExecutor" daemon prio=1 tid=0x80b7f30 nid=0x375e waiting on monitor [0x4acc9000..0x4acc9870]
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:415)
at com.swiftmq.tools.thread.Threadpool.getNextTask(Threadpool.java:118)
at com.swiftmq.tools.thread.PoolExecutor.run(PoolExecutor.java:46)


"PoolExecutor" daemon prio=1 tid=0x80f0cc8 nid=0x375d waiting on monitor [0x4aac9000..0x4aac9870]
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:415)
at com.swiftmq.tools.thread.Threadpool.getNextTask(Threadpool.java:118)
at com.swiftmq.tools.thread.PoolExecutor.run(PoolExecutor.java:46)


"PoolExecutor" daemon prio=1 tid=0x80f1968 nid=0x375c waiting on monitor [0x4a8c9000..0x4a8c9870]
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:415)
at com.swiftmq.tools.thread.Threadpool.getNextTask(Threadpool.java:118)
at com.swiftmq.tools.thread.PoolExecutor.run(PoolExecutor.java:46)


"Signal Dispatcher" daemon prio=1 tid=0x8096a78 nid=0x3759 waiting on monitor [0..0]


"Finalizer" daemon prio=1 tid=0x808ea60 nid=0x3756 waiting on monitor [0x49cbe000..0x49cbe870]
at java.lang.Object.wait(Native Method)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:103)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:157)


"Reference Handler" daemon prio=1 tid=0x808de90 nid=0x3755 waiting on monitor [0x49abe000..0x49abe870]
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:415)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:105)


"VM Thread" prio=1 tid=0x808adb0 nid=0x3754 runnable


"VM Periodic Task Thread" prio=1 tid=0x80956c8 nid=0x3757 waiting on monitor
"Suspend Checker Thread" prio=1 tid=0x80960a0 nid=0x3758 runnable

   <<Less

Re: Client applications hang after closing connections and sessions

Posted By:   Andreas_Mueller  
Posted On:   Friday, March 7, 2003 12:33 AM

1) Make sure that you close your InitialContext.

2) You're using SwiftMQ 3.2.0, please upgrade to 4.5.0, if possible.

3) Use JDK 1.4.1. AFAIK, there were fixes concerning preemtp closes for Linux (but I'm not absolutely sure).
About | Sitemap | Contact