Ignore timeout error when receiving message from sockect

When the clientchannel's receiver thread had crashed with
timeout error. the upside main procedure will contine with-
out any notifications,it may get stocked when no thread can
handle the messages later on.

this change just fix this situation by ignore the timeout
exception, maybe it's a arbitary decision and have a widely
effect.

I will abandon this change if better solution can provide

Change-Id: Ie6058c9b9ffeac7c9af8b3ca9f40ea2b3c940ec2
Closes-Bug: #1623286
This commit is contained in:
TommyLike 2016-09-14 10:24:33 +08:00
parent 61d66ac819
commit 3b53619017
1 changed files with 7 additions and 4 deletions

View File

@ -74,10 +74,13 @@ class Deserializer(six.Iterator):
try:
return next(self.unpacker)
except StopIteration:
buf = self.readsock.recv(4096)
if not buf:
raise
self.unpacker.feed(buf)
try:
buf = self.readsock.recv(4096)
if not buf:
raise
self.unpacker.feed(buf)
except socket.timeout:
pass
class Future(object):