Retry on broken pipe when writing to control

This commit is contained in:
Kovid Goyal 2020-12-08 10:24:09 +05:30
parent 62a0bdad07
commit 593eeaf9ea
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -648,6 +648,11 @@ class ServerLoop(object):
if iswindows: if iswindows:
self.control_in.sendall(what) self.control_in.sendall(what)
else: else:
try:
self.control_in.write(what)
self.control_in.flush()
except BrokenPipeError:
self.create_control_connection()
self.control_in.write(what) self.control_in.write(what)
self.control_in.flush() self.control_in.flush()