From 1a4628d4b9f07154dea13f695625ab46e37d6f22 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Dec 12 2015 17:53:09 +0000 Subject: koji: avoid double fault when handling a socket exception The attempt to close the errored connection can in fact raise another exception: 494 buildArch (attr-2.4.47-14.fc23.src.rpm, armv6hl): open (nvn.base48.cz) -> FAILED: Fault: --- diff --git a/koji/__init__.py b/koji/__init__.py index 8e297dc..124f600 100644 --- a/koji/__init__.py +++ b/koji/__init__.py @@ -1951,7 +1951,10 @@ class ClientSession(object): #(depending on the python version, these may or may not be subclasses of Exception) raise except Exception, e: - self._close_connection() + try: + self._close_connection() + except Exception, inner: + self.logger.debug("Ignoring socket error while handling an exception: %s", inner) if isinstance(e, OpenSSL.SSL.Error): # pyOpenSSL doesn't use different exception # subclasses, we have to actually parse the args