fix(logger): flush rolling buffer when executor errors#352
Merged
not-matthias merged 1 commit intoMay 14, 2026
Merged
Conversation
Merging this PR will not alter performance
|
When run_executor returned Err, the `?` short-circuit skipped deactivate_rolling_buffer(), leaving the rolling buffer active in its global static. Both the deferred profiler warning and the final error printed by main via log::error! got swallowed by the deferred-logs queue, hiding the actual failure cause from the user. Capture the result, always deactivate, then propagate. Closes COD-2665
1649fe4 to
149a618
Compare
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
run_executorreturnsErr, the?short-circuit was skippingdeactivate_rolling_buffer(). The rolling buffer stayed active in its global static, so both the deferred profiler warning (e.g. "Walltime profiling is enabled, but failed to detect benchmarks") and the final error printed bymainvialog::error!ended up queued inDEFERRED_LOGSand never flushed — the user saw the box close and the prompt return with no indication of what went wrong.deactivate_rolling_buffer()unconditionally, then propagate.finish()triggersflush_deferred_logs(), so queued warnings render above the final box, and by the timemaincallslog::error!the rolling buffer isNoneand the error prints normally.Closes COD-2665
Test plan
cargo r -- run --mode walltime -- lsshows the "Walltime profiling is enabled, but failed to detect benchmarks" warning and the "did not produce any CodSpeed result" error after the box closescargo r -- run --show-full-output --mode walltime -- lsbehavior unchanged