Skip to content

TICKET-597: Fix worker orphan processes and add max test timeout cap#710

Draft
Naragod wants to merge 2 commits intomasterfrom
TICKET-597_fix_worker_orphan_and_timeout
Draft

TICKET-597: Fix worker orphan processes and add max test timeout cap#710
Naragod wants to merge 2 commits intomasterfrom
TICKET-597_fix_worker_orphan_and_timeout

Conversation

@Naragod
Copy link
Copy Markdown
Contributor

@Naragod Naragod commented Mar 31, 2026

Description

Worker processes running student tests could become orphaned when the RQ worker crashed or restarted before cleanup ran, because start_new_session=True fully detached test processes into their own session. This made them invisible to process supervision and allowed them to run indefinitely, blocking the dedicated test user slot.

Implementation

  • Remove start_new_session=True from the subprocess call in order to reap test processes when the worker dies.
  • Introduces max_test_timeout server-side configuration (default 600s) that caps per-test timeouts, preventing instructor-configured or missing timeouts from letting tests hang forever during normal operation.
  • Removing start_new_session means os.killpg can no longer be used in the same-user (dev) path without killing the worker itself, so it is replaced with proc.kill() + proc.wait() to target the child process directly.

@Naragod Naragod marked this pull request as draft March 31, 2026 01:07
@Naragod Naragod force-pushed the TICKET-597_fix_worker_orphan_and_timeout branch from 98b4235 to e17503a Compare March 31, 2026 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant