fix: loadtest interrupt summary#925
Open
jhkimqd wants to merge 2 commits into
Open
Conversation
The previous one-shot select inside the spawned goroutine returned early if loadTestCtx was already cancelled when the goroutine first ran, leaving errCh empty. The subsequent drain (mainLoopErr = <-errCh) would then block forever. Drop the select. mainLoop itself respects ctx and returns promptly on cancellation, so the goroutine can unconditionally forward its result.
Previously, the LightSummary block lived inside postLoadTest, which was only reached from the natural-completion path. Three independent defects caused interrupt/timeout/error runs to exit with no summary at all: - log.Fatal on a non-nil mainLoop error called os.Exit(1), skipping postLoadTest and any deferred cleanup. Ctrl+C-induced ctx cancellation could surface as a regular error from in-flight setup RPCs, hitting this path and silently killing the summary. - The --time-limit timeout path returned early before postLoadTest. - log.Fatal also masked exit codes for genuinely-broken runs. Move the LightSummary call into a defer at the top of Run, with endTime captured before postLoadTest so the reported TPS reflects load-generation duration rather than post-test cleanup (refunds, --summarize receipt fetches). Drop the timeout early-return so all three exit paths share a single tail. Replace log.Fatal with log.Error and return the underlying error so Cobra propagates non-zero exit codes; filter context.Canceled so SIGINT exits 0. Also remove the duplicate preconfTracker.Stats() call from the SIGINT branch — postLoadTest already invokes it.
|
minhd-vu
approved these changes
May 19, 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.



Description