Skip to content

fix(runner): keep rolling buffer off during executor setup#411

Merged
not-matthias merged 1 commit into
mainfrom
cod-2907-sudofingerprint-prompt-during-codspeed-run-has-no-context
Jun 17, 2026
Merged

fix(runner): keep rolling buffer off during executor setup#411
not-matthias merged 1 commit into
mainfrom
cod-2907-sudofingerprint-prompt-during-codspeed-run-has-no-context

Conversation

@not-matthias

@not-matthias not-matthias commented Jun 17, 2026

Copy link
Copy Markdown
Member

Correctly prints the Sudo prompt now:

$ codspeed run -m memory -- eza /nix/store

› Running the benchmarks

  Granting codspeed-memtrack the capabilities it needs as a one-time setup for the memory instrument (requires sudo).
  Sudo privileges are required to continue.
Place your right index finger on the fingerprint reader

Fixes #410

Wrap only the benchmark execution in the rolling buffer, not setup. This
keeps sudo/fingerprint prompts raised during grant_privileges visible on
the terminal instead of being swallowed by the bounded output window.
@greptile-apps

greptile-apps Bot commented Jun 17, 2026

Copy link
Copy Markdown

Greptile Summary

This PR moves the rolling buffer activation from the orchestrator loop into run_executor, just before executor.run(), so that executor setup (tool installation, MongoDB tracer install) runs with the rolling buffer off and its output is not swallowed.

  • src/executor/orchestrator.rs: Removes the inline activate_rolling_buffer / deactivate_rolling_buffer calls and instead passes a rolling_buffer_label: Option<&str> down to run_executor.
  • src/executor/mod.rs: Adds the rolling_buffer_label parameter and activates/deactivates the buffer tightly around executor.run() only, preserving the error-propagation guarantee that the buffer is always torn down before run_result?.

Confidence Score: 5/5

Safe to merge — the change tightens the rolling buffer window to cover only the actual benchmark execution, with correct deactivation before error propagation.

Both files have straightforward, focused changes. The error-propagation guarantee from the old comment is preserved: deactivate_rolling_buffer() runs before run_result?. There is only one call site for run_executor and it has been updated. Setup and teardown output now reaches the terminal as intended.

No files require special attention.

Important Files Changed

Filename Overview
src/executor/mod.rs Adds rolling_buffer_label parameter; activates/deactivates rolling buffer only around executor.run() with correct error-propagation ordering.
src/executor/orchestrator.rs Removes rolling buffer lifecycle management from the execute loop; delegates it to run_executor via the new rolling_buffer_label parameter.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Orch as Orchestrator::execute
    participant RE as run_executor
    participant Exec as executor.run

    Note over Orch,Exec: Before this PR
    Orch->>Orch: activate_rolling_buffer()
    Orch->>RE: run_executor(...)
    RE->>RE: executor.setup() ← buffered/swallowed
    RE->>RE: install_mongodb_tracer() ← buffered/swallowed
    RE->>Exec: executor.run()
    RE-->>Orch: result
    Orch->>Orch: deactivate_rolling_buffer()

    Note over Orch,Exec: After this PR
    Orch->>RE: run_executor(..., rolling_buffer_label)
    RE->>RE: executor.setup() ← visible in terminal
    RE->>RE: install_mongodb_tracer() ← visible in terminal
    RE->>RE: activate_rolling_buffer()
    RE->>Exec: executor.run()
    RE->>RE: deactivate_rolling_buffer()
    RE-->>Orch: result
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Orch as Orchestrator::execute
    participant RE as run_executor
    participant Exec as executor.run

    Note over Orch,Exec: Before this PR
    Orch->>Orch: activate_rolling_buffer()
    Orch->>RE: run_executor(...)
    RE->>RE: executor.setup() ← buffered/swallowed
    RE->>RE: install_mongodb_tracer() ← buffered/swallowed
    RE->>Exec: executor.run()
    RE-->>Orch: result
    Orch->>Orch: deactivate_rolling_buffer()

    Note over Orch,Exec: After this PR
    Orch->>RE: run_executor(..., rolling_buffer_label)
    RE->>RE: executor.setup() ← visible in terminal
    RE->>RE: install_mongodb_tracer() ← visible in terminal
    RE->>RE: activate_rolling_buffer()
    RE->>Exec: executor.run()
    RE->>RE: deactivate_rolling_buffer()
    RE-->>Orch: result
Loading

Reviews (1): Last reviewed commit: "fix(runner): keep rolling buffer off dur..." | Re-trigger Greptile

@codspeed-hq

codspeed-hq Bot commented Jun 17, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 7 untouched benchmarks


Comparing cod-2907-sudofingerprint-prompt-during-codspeed-run-has-no-context (b29c40c) with main (e2da80a)

Open in CodSpeed

@GuillaumeLagrange GuillaumeLagrange left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, although just for completeness sake: you also left out the teardown logs out of the rolling buffer, which is fine still worth pointing it out

@not-matthias not-matthias merged commit b29c40c into main Jun 17, 2026
22 checks passed
@not-matthias not-matthias deleted the cod-2907-sudofingerprint-prompt-during-codspeed-run-has-no-context branch June 17, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sudo/fingerprint prompt during codspeed run has no context (rolling buffer swallows setup messages)

2 participants