Author: nsantos
Date: Mon May  3 21:33:43 2010
New Revision: 940631

URL: http://svn.apache.org/viewvc?rev=940631&view=rev
Log:
handle timeouts caused by long-executing commands, iterate until timeout clears

Modified:
    qpid/trunk/qpid/tools/src/py/qpid-config

Modified: qpid/trunk/qpid/tools/src/py/qpid-config
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/tools/src/py/qpid-config?rev=940631&r1=940630&r2=940631&view=diff
==============================================================================
--- qpid/trunk/qpid/tools/src/py/qpid-config (original)
+++ qpid/trunk/qpid/tools/src/py/qpid-config Mon May  3 21:33:43 2010
@@ -566,7 +566,18 @@ except IOError, e:
     print e
     sys.exit(1)
 except Exception,e:
-    print "Failed: %s: %s" % (e.__class__.__name__, e)
-    sys.exit(1)
-
-bm.Disconnect()
+    if e.__class__.__name__ != "Timeout":
+        # ignore Timeout exception, handle in the loop below
+        print "Failed: %s: %s" % (e.__class__.__name__, e)
+        sys.exit(1)
+ 
+while True:
+    # some commands take longer than the default amqp timeout to complete,
+    # so attempt to disconnect until successful, ignoring Timeouts
+    try:
+        bm.Disconnect()
+        break
+    except Exception, e:
+        if e.__class__.__name__ != "Timeout":
+            print "Failed: %s: %s" % (e.__class__.__name__, e)
+            sys.exit(1)



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscr...@qpid.apache.org

Reply via email to