Commit 2cfa90a4 authored by Guillaume Hervier's avatar Guillaume Hervier

Exit stalled requests on connection error.

If the SSH connection stalled or just existed during a restore, the whole process would stall as it waits for requests which will never finish.

This MR makes the connection propagate the `ConnectionQuit` exception to stalled requests when the connection is cut in the middle of the process, so they will terminate with an exception and raise it, exiting the whole program instead of making it stall

/reviewed-on !6
parent 174472d6
......@@ -341,7 +341,10 @@ class PipeConnection(LowLevelPipeConnection):
while True:
try:
req_num, obj = self._get()
except ConnectionQuit:
except ConnectionQuit as e:
# Terminate all pending requests
for req in self.requests.values():
req.set(e)
self._close()
break
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment