Repository navigation
[RLlib] Skip the MARWILConfig doctest instead of PPOConfig - #68478
Merged
pseudo-rnd-thoughts merged 1 commit intoNov 23, 2026
Merged
pseudo-rnd-thoughts merged 1 commit into
pseudo-rnd-thoughts merged 1 commit into
Conversation
The //python/ray/rllib:doctest crash blamed on PPOConfig (ray-project#68306) comes from the MARWILConfig example that runs before it. That example builds an Algorithm in the driver and leaves a partly consumed Ray Data iter_batches generator, whose prefetch threads are still alive when the next module's ray.shutdown() runs. One of them releases an ObjectRef after the core worker is gone, which hits QuickExit and kills the process with no traceback. With PPOConfig skipped, the crash moved to SACConfig. Skip MARWILConfig, the source, and re-enable PPOConfig. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Mark Towers <[email protected]>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates documentation examples for MARWILConfig and PPOConfig. It adds a descriptive comment and skips the gymnasium import example in MARWILConfig to address CI issues, while removing the skip directive and the associated explanation comment from the PPOConfig examples. I have no feedback to provide.
dstrodtman
approved these changes
Nov 23, 2026
pseudo-rnd-thoughts
enabled auto-merge (squash)
November 23, 2026 13:43
ArturNiederfahrenhorst
approved these changes
Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
:brain: rllib: docs example tests(//python/ray/rllib:doctest) crashes with exit code 1 and no traceback. #68306 skippedPPOConfigfor this, and the crash moved toSACConfig, the next module. Neither example is at fault: the crash happens in whichever module runs afterMARWILConfig.The first
MARWILConfigexample builds anAlgorithmin the driver withnum_learners=0anddataset_num_iters_per_learner=1, soOfflineData.sample()keeps a partly consumediter_batches()generator, and its Ray Data prefetch threads stay alive. The example never callsalgo.stop(), andAlgorithm.cleanup()doesn't close that generator anyway. When the plugin's module fixture callsray.shutdown()before the next module, one of those threads releases anObjectRefafter the core worker is gone, and the process exits throughQuickExit(). The driver's core-worker log shows it, from a non-main thread about 120 ms after shutdown:This matches the diagnosis @vishalkotak posted on #68305.
This PR:
MARWILConfig(the source) with# doctest: +SKIP_EXAMPLEand aNOT TESTED IN CIcomment linking [RLlib] rllib doctest target: examples disabled from CI #68305.ppo.py, soPPOConfigruns again.Follow-ups, not in this PR:
Algorithm.cleanup()and callalgo.stop()in the MARWIL example, then remove this skip. I have a local patch; with it, MARWIL → PPO → SAC passed 3/3 locally, and without it the run crashed 2/2.ObjectRefduringray.shutdown()shouldn't_Exit(1)the process. [Data] Wait for iter_threaded workers to exit when the consumer stops #67868 (a Data-side workaround) was closed in favor of a core fix.Related issue number
Related to #68305. Supersedes the skip from #68306.
Duplicate check
No open PR references #68305 or touches
MARWILConfig's doctest. I searched open PRs for68305 in:body,rllib doctest, andMARWIL doctest.Testing
Locally on macOS, Python 3.12, editable build, using the target's arguments and plugin (from
python/):2 passed, 1 skipped(MARWIL skipped, PPO and SAC passed), 4/4 runs.--continue-on-collection-errors):84 passed, 29 skipped, 5 failed, 2 errors, and the run completed. The 5 failures areRolloutWorker.*examples that need TensorFlow, and the 2 errors areopen_spiel.pyneedingpyspiel. Neither package is in my local env, but both are on CI.My local run collected 118 examples against CI's 262, so it doesn't stand in for CI. Premerge skips this target while it's flaky, so a scheduled postmerge run will confirm it.
pre-commit runon the changed files passes.AI assistance
AI assistance (Claude Code) helped with the diagnosis, local runs, and drafting. I reviewed the change and the results.
🤖 Generated with Claude Code