Skip to content

Don't rearm WebSocket heartbeat after close - #14236

Open
rinopatrick wants to merge 2 commits into
aio-libs:masterfrom
rinopatrick:fix/14125-heartbeat-rearmed-on-close
Open

rinopatrick wants to merge 2 commits into
aio-libs:masterfrom
rinopatrick:fix/14125-heartbeat-rearmed-on-close

Conversation

@rinopatrick

Copy link
Copy Markdown

Closes #14125.

Peer-close data arriving after the close handshake scheduled a deferred heartbeat reset (via call_soon); when it ran, _reset_heartbeat re-created the heartbeat timer on a connection whose public closed property was already true. The deferred reset is now dropped when the connection is closing or closed.

Tests: new test_flush_heartbeat_reset_does_not_rearm_after_close (fails before, passes after); full test_web_websocket.py green (63 passed).

@agentscanapp

agentscanapp Bot commented Nov 2, 2026

Copy link
Copy Markdown

Automation signals

Activity patterns show signs of automation.

View full analysis →

Report this account →

Evidence
  • Closed PRs across many repositories: 21 PRs were closed across 3 repositories in 3h, with a spike of 21 closures on one day.
  • Very high PR volume (daily): 45 PRs within a single 24-hour window
  • Multiple forks: 7 repositories forked in a single 24-hour window
  • Rapid PRs to repository: 8 PRs opened to rinopatrick/reign within 14s intervals
  • Issue comment and PR within minutes: Commented on an issue and opened a PR to the same repo within 5 minutes, in 5 repositories (the fastest took 84s)

Last 5 PRs:

This is an automated analysis by AgentScan

@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.11%. Comparing base (b4beb73) to head (51cd05e).
⚠️ Report is 2 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
aiohttp/web_ws.py 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #14236    +/-   ##
========================================
  Coverage   99.11%   99.11%            
========================================
  Files         135      135            
  Lines       53338    53452   +114     
  Branches     2717     2725     +8     
========================================
+ Hits        52865    52978   +113     
  Misses        359      359            
- Partials      114      115     +1     
Flag Coverage Δ
Autobahn 21.67% <6.25%> (-0.03%) ⬇️
CI-GHA 99.04% <87.50%> (+<0.01%) ⬆️
OS-Linux 98.69% <87.50%> (+0.01%) ⬆️
OS-Windows 97.48% <87.50%> (+<0.01%) ⬆️
OS-macOS 98.34% <87.50%> (-0.01%) ⬇️
Py-3.11 98.29% <87.50%> (-0.01%) ⬇️
Py-3.12 98.37% <87.50%> (-0.01%) ⬇️
Py-3.13 98.36% <87.50%> (-0.01%) ⬇️
Py-3.14 98.38% <87.50%> (-0.01%) ⬇️
Py-3.15 98.38% <87.50%> (-0.01%) ⬇️
Py-3.15t 98.24% <87.50%> (+<0.01%) ⬆️
Py-pypy-3.12 96.96% <87.50%> (+0.02%) ⬆️
VM-macos-latest 98.34% <87.50%> (-0.01%) ⬇️
VM-ubuntu-latest 98.69% <87.50%> (+0.01%) ⬆️
VM-windows-latest 97.48% <87.50%> (+<0.01%) ⬆️
cython-coverage 83.79% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@greptile-apps

greptile-apps Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: apex

[Low impact] The PR appears safe to merge; no outstanding findings remain.

Reviews (2) · Last reviewed commit: "fix(changelog): add PR-numbered symlink" · Reviewed by Greptile

Comment thread CHANGES/14125.bugfix.rst Resolved
@codspeed

codspeed Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 48 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 102 untouched benchmarks
⏩ 83 skipped benchmarks1


Comparing rinopatrick:fix/14125-heartbeat-rearmed-on-close (51cd05e) with master (a2c6c92)

Open in CodSpeed

Footnotes

  1. 83 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

This branch has not been deployed

No deployments
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.

Server WebSocket heartbeat is rearmed during close and survives public cleanup

1 participant