fix(runtime): drain autoscaler example phases - #1036
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes the autoscaler example’s queued-task lifetime issue by draining each load phase before releasing captured state.
Changes:
- Retains join handles and verifies each phase fully drains.
- Adds shorter default and
--smokeworkloads. - Adds CI smoke coverage and updates documentation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
examples/autoscaler_example.cpp |
Implements safe phase draining and smoke mode. |
.github/workflows/ci.yml |
Runs the smoke example with a timeout. |
wiki/Examples.md |
Documents phase lifetime and smoke usage. |
CHANGELOG.md |
Records the autoscaler example fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Description
Make each autoscaler example load phase own and drain its submitted work before
the phase-local completion counter is released. This removes the queued-task
use-after-scope reported in #1022 and ensures the low-load phase starts only
after the high-load phases are empty.
The default workload now completes in a few seconds, while a dedicated
--smokemode provides a short, timeout-bounded CI termination regression.Type of Change
Related Issues
Closes #1022
Changes Made
Core Changes
join_handleper submitted task and wait for frame destructionbefore a phase returns; the exceptional submission path drains already
accepted tasks as well.
before entering the next phase.
a sub-second
--smokeprofile.matrix job.
API Changes
No library API or contract changes. The example adds the optional
--smokecommand-line flag.
Testing
Unit Tests
Integration Tests
Sanitizer Testing
Test Results
Checklist
Code Quality
Documentation
Testing
Compatibility
CHANGELOG.mdis updatedPerformance
Reviewer Guidance
Areas requiring special attention:
before the phase-local atomic is destroyed.
exact completion count and zero pending tasks.
of exact timing or worker-count assertions on shared CI runners.