Skip to content

fix(environment-server): log a timed-out cleanup callback by name and pin the per-callback budget - #4603

Merged
ananthsub merged 1 commit into
mainfrom
adasif/cleanup-context-per-callback-budget
Oct 14, 2026
Merged

ananthsub merged 1 commit into
mainfrom
adasif/cleanup-context-per-callback-budget

Conversation

@adil-a

@adil-a adil-a commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What

main already bounds each cleanup callback on its own since #3902 (CleanupContext.aclose runs every callback under its own cleanup_timeout_seconds). This PR keeps the two pieces that were not part of that change:

  • an explicit TimeoutError branch that logs the name of the callback that timed out (the generic branch logged a traceback without saying which owner hung);
  • test_each_cleanup_has_its_own_budget, which pins that a slow close no longer eats the time a hung one left and that the sandbox stop at the bottom of the stack still runs, with a bound on total time.

Rebased onto main after #3902; the earlier version of this PR carried the per-callback loop itself.

Test

pytest tests/unit_tests/test_environment_server.py -q   # 21 passed

🤖 Generated with Claude Code

@copy-pr-bot

copy-pr-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@adil-a
adil-a requested a review from ananthsub October 14, 2026 16:51
ananthsub
ananthsub previously approved these changes Oct 14, 2026
@ananthsub

Copy link
Copy Markdown
Contributor

/ok to test cac3cbd

@adil-a

adil-a commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test cac3cbd

@copy-pr-bot

copy-pr-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

/ok to test cac3cbd

@adil-a, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

@github-actions

Copy link
Copy Markdown
Contributor

@yaoyu-33 yaoyu-33 added area:env-infra Shared environment framework, lifecycle, registry, scaffolding, and validation bug Something isn't working complexity:low Localized change in one scope with a small, straightforward review surface ready-to-merge PR is approved, current, and waiting for final CI or merge labels Oct 14, 2026
… pin the per-callback budget

main (#3902) already bounds each cleanup callback on its own. This keeps the two
pieces that were not there: a log line naming the callback that timed out, and a
test that pins the per-callback budget (a slow close no longer eats the time a hung
one left, and the sandbox stop at the bottom of the stack still runs).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
@adil-a
adil-a force-pushed the adasif/cleanup-context-per-callback-budget branch from cac3cbd to 8d3b220 Compare October 14, 2026 19:47
@adil-a adil-a changed the title fix(environment-server): bound each cleanup callback on its own fix(environment-server): log a timed-out cleanup callback by name and pin the per-callback budget Oct 14, 2026
@adil-a

adil-a commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 8d3b220

@ananthsub
ananthsub enabled auto-merge October 14, 2026 19:59
@ananthsub
ananthsub added this pull request to the merge queue Oct 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/38629383523

Merged via the queue into main with commit 5854c28 Oct 14, 2026
49 of 54 checks passed
@ananthsub
ananthsub deleted the adasif/cleanup-context-per-callback-budget branch October 14, 2026 20:21

This branch was previously deployed

1 inactive deployment
public — 8d3b2203 Deployed Oct 14, 2026 by copy-pr-bot[bot] via release / finalize / notify #5361
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:env-infra Shared environment framework, lifecycle, registry, scaffolding, and validation bug Something isn't working complexity:low Localized change in one scope with a small, straightforward review surface ready-to-merge PR is approved, current, and waiting for final CI or merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants