Skip to content

Avoid Locust master port collisions in virtual benchmarks - #8301

Merged
Amaury Chamayou (achamayou) merged 4 commits into
mainfrom
copilot/fix-benchmark-virtual-job-failure
Sep 7, 2026
Merged

Avoid Locust master port collisions in virtual benchmarks#8301
Amaury Chamayou (achamayou) merged 4 commits into
mainfrom
copilot/fix-benchmark-virtual-job-failure

Conversation

Copilot AI commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Benchmark Virtual could fail when Locust selected a port available on loopback but then bound its master listener on all interfaces. Another process bound on a non-loopback interface caused Locust startup to fail.

  • Locust master binding
    • Bind the master RPC listener explicitly to localhost.
    • Select the port using the same loopback address scope.
master_host = "localhost"
master_port = infra.net.probably_free_local_port(master_host)
cmd += ["--master-bind-host", master_host, ...]

Copilot AI and others added 2 commits September 7, 2026 14:33
Co-authored-by: eddyashton <6000239+eddyashton@users.noreply.github.com>
Co-authored-by: eddyashton <6000239+eddyashton@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job 'Benchmark Virtual' Avoid Locust master port collisions in virtual benchmarks Sep 7, 2026
@eddyashton
Eddy Ashton (eddyashton) marked this pull request as ready for review September 7, 2026 14:39
@eddyashton
Eddy Ashton (eddyashton) requested a review from a team as a code owner September 7, 2026 14:39
Copilot AI lite review requested due to automatic review settings September 7, 2026 14:39

Copilot AI 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.

🟢 Approval recommended

The change is small, localized, and directly addresses the stated failure mode by aligning port selection and bind scope to loopback.

Pull request overview

This PR hardens the virtual benchmark Locust invocation to avoid master port collisions caused by selecting a port on loopback but then binding the master listener on all interfaces.

Changes:

  • Introduces an explicit master_host = "localhost" for Locust master binding.
  • Selects master_port using the same loopback scope and passes --master-bind-host to ensure Locust binds only on loopback.

Custom instructions used

  • None (no repository instruction files from .github/copilot-instructions.md / .github/instructions/ were explicitly loaded via tools during this review).
File summaries
File Description
tests/infra/locust_benchmark.py Bind Locust master RPC listener explicitly to loopback and select the port using the same address scope to prevent interface-scope collisions.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@achamayou
Amaury Chamayou (achamayou) merged commit 28d40d2 into main Sep 7, 2026
13 checks passed
@achamayou
Amaury Chamayou (achamayou) deleted the copilot/fix-benchmark-virtual-job-failure branch September 7, 2026 19:16
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.

4 participants