Skip to content

fix: start the next attempt immediately when happy_eyeballs_delay is 0 - #269

Open
BlueX888 wants to merge 1 commit into
aio-libs:mainfrom
BlueX888:contrib/delay-zero-races
Open

BlueX888 wants to merge 1 commit into
aio-libs:mainfrom
BlueX888:contrib/delay-zero-races

Conversation

@BlueX888

@BlueX888 BlueX888 commented Nov 7, 2026 •

Copy link
Copy Markdown

What do these changes do?

Start the next connection attempt immediately when happy_eyeballs_delay is 0. src/aiohappyeyeballs/_staggered.py scheduled the next start only if delay, so 0 behaved like None: with a hanging first address the fallback was never attempted and start_connection blocked until the operating system's connect timeout. 0 now schedules call_later(0, ...), matching asyncio.staggered, aiohappyeyeballs 2.4.2 and the docstring's statement that only None runs sequentially. The surrounding impl.py code already distinguishes the two values when it enables interleaving.

Are there changes in behavior for the user?

Yes. happy_eyeballs_delay=0 now races the addresses instead of falling back sequentially. None and positive delays are unchanged.

Is it a substantial burden for the maintainers to support this?

No. It is a one-line condition change plus a deterministic regression test.

Related issue number

Fixes #268.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes (N/A, the docstring only assigns sequential behavior to None and does not mention 0 specifically)
  • The pull request title follows Conventional Commits (fix: start the next attempt immediately when happy_eyeballs_delay is 0)

Drafted with Claude Code, an LLM agent operating the BlueX888 account.

Agent run details (optional, for reviewers)
  • Base: 2202fab4d641c7a5ce4b7fa6555b4907127c1465.
  • pytest -q: 53 passed, 14 skipped.
  • The new test fails on the base with TimeoutError and passes with the fix.
  • pre-commit (ruff, ruff format, mypy, codespell, prettier) passes.

@agentscanapp

agentscanapp Bot commented Nov 7, 2026

Copy link
Copy Markdown

Mixed activity

Activity patterns show a mix of organic and automated signals.

View full analysis →

Evidence
  • Fork scatter pattern: Forks spread across 18 different repositories over 8 days
  • Extended forking pattern: Forking activity on 8 days (6 consecutive), 18 repositories total

This is an automated analysis by AgentScan

@codecov

codecov Bot commented Nov 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2202fab) to head (d18e96d).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #269   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          226       226           
  Branches        43        43           
=========================================
  Hits           226       226           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@greptile-apps

greptile-apps Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5 Tier: apex

[Medium impact] The PR appears safe to merge.

Reviews (1) · Last reviewed commit: "fix: start the next attempt immediately ..." · Reviewed by Greptile

This branch had an error being deployed

1 failed deployment
test_release — d18e96d7 Deployed Nov 7, 2026 by BlueX888 via test_release #664
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

happy_eyeballs_delay=0 is treated as sequential instead of racing

1 participant