Skip to content

Commit e0af547

Browse files
committed
Improve error handling for hung interactive keeper
1 parent 184c031 commit e0af547

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cms/grading/tasktypes/Interactive.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,11 @@ def evaluate(self, job, file_cacher):
252252
stdin=subprocess.DEVNULL,
253253
stdout=subprocess.PIPE,
254254
)
255-
stdout, _ = p.communicate(timeout=self.controller_wall_limit * 2)
255+
try:
256+
stdout, _ = p.communicate(timeout=self.controller_wall_limit * 2)
257+
except subprocess.TimeoutExpired:
258+
p.kill()
259+
stdout, _ = p.communicate()
256260

257261
KEEPER_ERROR_MESSAGE = "Internal error in interactive keeper"
258262

0 commit comments

Comments
 (0)