From 6397c46f6716e8904fa3ed84ea8f2d14b6c824ac Mon Sep 17 00:00:00 2001 From: Nuno Santos Date: Mon, 3 May 2010 21:33:43 +0000 Subject: handle timeouts caused by long-executing commands, iterate until timeout clears git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@940631 13f79535-47bb-0310-9956-ffa450edef68 --- tools/src/py/qpid-config | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tools/src/py/qpid-config b/tools/src/py/qpid-config index 24a20b0431..f086ab9ac2 100755 --- a/tools/src/py/qpid-config +++ b/tools/src/py/qpid-config @@ -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) -- cgit v1.2.1