[Backport] Ignore timeout error when receiving message

Bug has been fixed in oslo.privsep 1.14.0, this patch intends
to backport this patch in stable/newton.

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

This change just fix this situation by ignore the timeout
exception.

Change-Id: Ie6058c9b9ffeac7c9af8b3ca9f40ea2b3c940ec2
Closes-Bug: #1645172
(cherry picked from commit 3b53619017)
This commit is contained in:
TommyLike 2016-09-14 10:24:33 +08:00
parent 7663ac0fdd
commit d186635525
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):