Handle TLS errors in receivequeuethread

- well at least EBADF, it seems to happen sometimes
master
Peter Šurda 6 years ago
parent 4f19c37fdc
commit aa059d6f2f
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

@ -1,4 +1,6 @@
import errno
import Queue
import socket
import sys
import threading
import time
@ -43,4 +45,9 @@ class ReceiveQueueThread(threading.Thread, StoppableThread):
# AttributeError = state isn't implemented
except (KeyError, AttributeError):
pass
except socket.error as err:
if err.errno == errno.EBADF:
BMConnectionPool().getConnectionByAddr(dest).set_state("close", 0)
else:
logger.error("Socket error: %s", str(err))
receiveDataQueue.task_done()

Loading…
Cancel
Save