Skip to content

Bind the Locust master to IPv4 loopback - #8308

Merged
Amaury Chamayou (achamayou) merged 2 commits into
mainfrom
achamayou-workflow-investigation
Sep 8, 2026
Merged

Bind the Locust master to IPv4 loopback#8308
Amaury Chamayou (achamayou) merged 2 commits into
mainfrom
achamayou-workflow-investigation

Conversation

@achamayou

Copy link
Copy Markdown
Member

Summary

Follow-up to #8301, fixing the Benchmark Virtual failure on its merge commit, 28d40d248.

localhost can resolve to both IPv4 and IPv6. Locust 2.46.5 then enables IPv6 for its ZeroMQ listener, while the port probe and forked workers use IPv4. If ::1 is unavailable, the master fails with:

Socket bind failure: Cannot assign requested address (addr='tcp://localhost:43749')

This affected all five Locust benchmarks; their workers subsequently spent about five minutes retrying connections.

Use 127.0.0.1 explicitly for the port probe and master binding. This preserves #8301's loopback-only binding and port-collision protection without depending on hostname resolution or IPv6 availability.

Validation

  • Reproduced the exact failure with Locust 2.46.5 in an isolated Linux network/mount namespace where localhost resolves to both address families but IPv6 loopback is unavailable.
  • Confirmed that explicit IPv4 binding succeeds and a worker/master RPC round trip completes in the same environment.
  • scripts/ci-checks.sh -f passed under WSL.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 7, 2026 21:24
@achamayou
Amaury Chamayou (achamayou) requested a review from a team as a code owner September 7, 2026 21:24

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 minimal, consistent with existing IPv4-only port probing (AF_INET), and directly addresses the documented Locust bind failure scenario without introducing new behavioral risk.

Pull request overview

This PR updates the Locust benchmark harness to bind the Locust master RPC listener explicitly to the IPv4 loopback address, avoiding failures in environments where localhost resolves to IPv6 but ::1 is unavailable.

Changes:

  • Switch Locust master binding host from localhost to 127.0.0.1.
  • Add an inline comment clarifying the IPv4/IPv6 rationale and matching of probe/worker behavior.

Custom instructions used: None (no repository instruction files were separately loaded from .github/copilot-instructions.md or .github/instructions/ during this review).

File summaries
File Description
tests/infra/locust_benchmark.py Bind Locust master explicitly to 127.0.0.1 to avoid localhost IPv6 resolution issues and keep port probing/binding consistent.
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 2227b30 into main Sep 8, 2026
13 checks passed
@achamayou
Amaury Chamayou (achamayou) deleted the achamayou-workflow-investigation branch September 8, 2026 08:30
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.

3 participants