Repository navigation
feat: print partial report and exit 130 on SIGINT - #25
Merged
Merged
Conversation
async 0.18+ cancels the whole program on SIGINT/SIGTERM by default via moonbitlang/async/signal, which previously propagated straight out of coordinator.run()'s task group and killed the process before any stats were reported. Catch only @async.is_cancellation_error and fall through to the existing finalize/report path so partial stats are still collected and printed, then exit 130 (128 + SIGINT) once main has finished reporting. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #25 +/- ##
==========================================
+ Coverage 70.81% 71.73% +0.91%
==========================================
Files 16 16
Lines 747 750 +3
==========================================
+ Hits 529 538 +9
+ Misses 218 212 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
When a load test is interrupted with Ctrl-C (SIGINT),
molt now prints the statistics collected so far and exits with code 130 (128 + SIGINT),
instead of dying without a report.
Since async 0.18, SIGINT/SIGTERM cancel the whole async program gracefully by default.
Previously that cancellation propagated straight out of
coordinator.run()'s task group and killed the process reportless.Changes
coordinator.run()catches cancellation (via the public@async.is_cancellation_errorpredicate; any other task-group failure still propagates) and falls through to the existing finalize/report path, so partial stats are collected and printed. TUI terminal restore (on_cleanup) runs before the report, unchangedrun()now returnsRunOutcome { stats, interrupted }instead of bareStats, keeping the interrupted state explicit without touching the sharedStatstypemainexits 130 when interrupted; this takes precedence over threshold (3) and failed-request (2) exit codes.Both signal-triggered and externally-induced cancellation flow through the same
Cancellederror in the async runtime (verified in the moonbitlang/async source), so one mechanism covers bothpanic()after@sys.exit(3)in the threshold pathVerification
coordinator.runmid-flight, assert partial stats are returned withinterrupted=true) was confirmed failing to compile before the implementation existedmoon test --target native272/272,moon test(wasm-gc) 195/195, after rebasing onto current mainKnown minor behavior: requests in flight at the moment of cancellation are recorded as
Other(Cancelled)errors in the report (2 occurrences in the E2E run above). Left as-is in this PR to keep the change minimal.🤖 Generated with Claude Code