Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 609035

Summary: Threading exception when running multiple python clients in parallel
Product: Red Hat Enterprise MRG Reporter: Jiri Kolar <jkolar>
Component: python-qpidAssignee: messaging-bugs <messaging-bugs>
Status: CLOSED DUPLICATE QA Contact: MRG Quality Engineering <mrgqe-bugs>
Severity: high Docs Contact:
Priority: high    
Version: DevelopmentCC: freznice, gsim
Target Milestone: 1.3   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-02 11:54:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jiri Kolar 2010-06-29 09:10:45 UTC
Description of problem:
this exception randomly appear when using qpid-config or any other qpid clients:

Exception in thread Thread for broker: 127.0.0.1:9305 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
  File "/usr/lib/python2.4/site-packages/qmf/console.py", line 2536, in run
  File "/usr/lib/python2.4/Queue.py", line 125, in get
exceptions.TypeError: 'NoneType' object is not callable
Unhandled exception in thread started by 
Error in sys.excepthook:

Original exception was:
Exception in thread Thread for broker: 127.0.0.1:23669 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
  File "/usr/lib/python2.4/site-packages/qmf/console.py", line 2536, in run
  File "/usr/lib/python2.4/Queue.py", line 125, in get
exceptions.TypeError: 'NoneType' object is not callable
Unhandled exception in thread started by 
Error in sys.excepthook:


Version-Release number of selected component (if applicable):
both python-qpid-0.7.938298-1 (current stable)
and python-qpid-0.7.946106-2 

How reproducible:
ocasionaly 

Steps to Reproduce:
1.run multiple python clients (for example qpid-config) in parallel and repeat in a loop
2.
3.
  
Actual results:
Exception occur

Expected results:
No exception

Additional info:

I personlly have seen this only on i386 , but might appear on x86_64 as well

Comment 1 Frantisek Reznicek 2010-06-29 14:50:43 UTC
This is also very easily seen by looping qpid-stat -b on a cluster node:


Brokers
  broker            cluster           uptime     conn  sess  exch  queue
  ========================================================================
  10.34.33.62:5672  fcluster(ACTIVE)  2h 2m 6s      7     4     8    60
  10.34.33.63:5672  fcluster(ACTIVE)  2h 1m 26s     3     3     8    50
  10.34.33.64:5672  fcluster(ACTIVE)  2h 1m 35s     2     2     8    50
  10.34.33.65:5672  fcluster(ACTIVE)  2h 1m 34s     2     2     8    55
Exception in thread Thread for broker: 10.34.33.65:5672 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "/usr/lib64/python2.4/threading.py", line 442, in __bootstrap
  File "/usr/lib/python2.4/site-packages/qmf/console.py", line 2536, in run
  File "/usr/lib64/python2.4/Queue.py", line 125, in get
exceptions.TypeError: 'NoneType' object is not callable
Unhandled exception in thread started by
Error in sys.excepthook:

Original exception was:


Tested on RHEL 5.5 x86_64 and python-qpid-0.7.946106-3.el5, python-qmf-0.7.946106-4.el5


Repro:
while true; do for i in 09 10 11 12; do qpid-cluster mrg-qe-${i} ; qpid-stat -b mrg-qe-${i}; done done

I raised prio and severity to high/high, feel free to change if you disagree.

Comment 2 Gordon Sim 2010-06-30 09:46:29 UTC
The qpid-stat against a cluster case is easily reproducible and the cause is obvious. In the case of a clustered broker it adds connections for each address in the known list but does not close these down on BrokerManager.disconnect().

The following fixes this specific case:

Index: tools/src/py/qpid-stat
===================================================================
--- tools/src/py/qpid-stat	(revision 959242)
+++ tools/src/py/qpid-stat	(working copy)
@@ -161,6 +161,7 @@
     def Disconnect(self):
         if self.broker:
             self.qmf.delBroker(self.broker)
+        for b in self.brokers: self.qmf.delBroker(b.broker)
 
     def _getCluster(self):
         packages = self.qmf.getPackages()

I can't reproduce the exception with qpid-config.

Comment 3 Jiri Kolar 2010-07-02 11:45:55 UTC
I am sorry , i checked and it was qpid-stat not qpid-config.

Comment 4 Gordon Sim 2010-07-02 11:54:19 UTC

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