Close might get called more than once

Since close can be called more than once handle and log exceptions
This commit is contained in:
Daniel A Wozniak 2018-04-25 06:50:16 +00:00 committed by Daniel A. Wozniak
parent dbe671f943
commit 4100dcd64c
No known key found for this signature in database
GPG key ID: 166B9D2C06C82D61

View file

@ -558,7 +558,11 @@ class TCPReqServerChannel(salt.transport.mixins.auth.AESReqServerMixin, salt.tra
self._socket.close()
self._socket = None
if hasattr(self.req_server, 'stop'):
self.req_server.stop()
try:
self.req_server.stop()
except Exception as exc:
log.debug("TCPReqServerChannel close generated an exception: %s" str(exc))
def __del__(self):
self.close()