Fixing a super weird issue ljf encountered where the reader crashed because couldn't read the filescriptor ... Yolocommiting, let's see if this breaks something during our tests during next weeks ...

This commit is contained in:
Alexandre Aubin 2020-03-29 00:41:37 +01:00
parent 4c6945fe04
commit 06d8c48918

View file

@ -43,9 +43,13 @@ class AsynchronousFileReader(Process):
else:
data = ""
while True:
try:
# Try to read (non-blockingly) a few bytes, append them to
# the buffer
data += os.read(self._fd, 50)
except Exception as e:
print("from moulinette.utils.stream: could not read file descriptor : %s" % str(e))
continue
# If nobody's writing in there anymore, get out
if not data and os.fstat(self._fd).st_nlink == 0: