2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-23 18:11:15 +00:00

Catch more broad errors

Operating on a closed socket is not a socket.error
This commit is contained in:
Jarrod Johnson 2018-07-16 11:58:18 -04:00
parent 7462bc28e8
commit 13aa2e9aae

View File

@ -68,7 +68,6 @@ import operator
import os
import random
import re
import eventlet.green.socket as socket
import string
import struct
import sys
@ -474,7 +473,7 @@ def relay_slaved_requests(name, listener):
cfgstreams[name] = listener
try:
msg = listener.recv(8)
except socket.error:
except Exception:
msg = None
while msg:
if name not in cfgstreams:
@ -493,7 +492,7 @@ def relay_slaved_requests(name, listener):
_push_rpc(listener, cPickle.dumps({'xid': rpc['xid']}))
try:
msg = listener.recv(8)
except socket.error:
except Exception:
msg = None
finally:
try:
@ -581,7 +580,7 @@ def follow_channel(channel):
stop_following(channel)
try:
msg = channel.recv(8)
except socket.error:
except Exception:
msg = None
while msg:
sz = struct.unpack('!Q', msg)[0]
@ -601,7 +600,7 @@ def follow_channel(channel):
_pendingchangesets[rpc['xid']].send()
try:
msg = channel.recv(8)
except socket.error:
except Exception:
msg = None
# mark the connection as broken
stop_following(True)