diff --git a/tchannel/tornado/connection.py b/tchannel/tornado/connection.py index 39635a02..0f8f07ff 100644 --- a/tchannel/tornado/connection.py +++ b/tchannel/tornado/connection.py @@ -310,7 +310,13 @@ def write(self, message): def close(self): if not self.closed: - self.connection.close() + # TODO this is a temporary fix against "socket is None" error + # that randomly happens in vcr-related tests. + # https://github.com/uber/tchannel-python/issues/416 + try: + self.connection.close() + except: + log.exception('Error when closing connection') self.closed = True @tornado.gen.coroutine