Skip to content

Commit 184c031

Browse files
committed
Fix controller hang when submission exits early
1 parent 6a28840 commit 184c031

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

cms/grading/tasktypes/interactive_keeper.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,8 @@ def main():
8787
for i in range(process_limit):
8888
c_to_u_r, c_to_u_w = os.pipe()
8989
u_to_c_r, u_to_c_w = os.pipe()
90-
os.set_inheritable(c_to_u_r, True)
9190
os.set_inheritable(c_to_u_w, True)
9291
os.set_inheritable(u_to_c_r, True)
93-
os.set_inheritable(u_to_c_w, True)
9492
pipes.append({"c_to_u": (c_to_u_r, c_to_u_w), "u_to_c": (u_to_c_r, u_to_c_w)})
9593

9694
controller_sandbox = Sandbox(0, shard, name="controller", temp_dir=temp_dir)
@@ -165,7 +163,8 @@ def main():
165163
wait=False,
166164
)
167165

168-
os.close(p["c_to_u"][0])
166+
# We do not close p["c_to_u"][0] -- it only risks crashing the
167+
# controller with SIGPIPE if the submission exits early.
169168
os.close(p["u_to_c"][1])
170169

171170
try:

0 commit comments

Comments
 (0)