Skip to content

Commit 2535177

Browse files
committed
Catch IOError in jailguard when child stdin closes while writing to it
1 parent c45c50d commit 2535177

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

worker/jailguard.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,13 @@ def child_writer(self):
6363
ln = queue.get()
6464
if ln is None:
6565
break
66-
stdin.write(ln)
67-
stdin.flush()
66+
try:
67+
stdin.write(ln)
68+
stdin.flush()
69+
except IOError as exc:
70+
if exc.errno == 32:
71+
break
72+
raise
6873

6974
def cmd_loop(self, pipe):
7075
while True:

0 commit comments

Comments
 (0)