Skip to content

Fix documented default for WebSocketResponse writer_limit - #13294

Open
LALITH0110 wants to merge 2 commits into
aio-libs:masterfrom
LALITH0110:docs/websocketresponse-writer-limit-default
Open

Fix documented default for WebSocketResponse writer_limit#13294
LALITH0110 wants to merge 2 commits into
aio-libs:masterfrom
LALITH0110:docs/websocketresponse-writer-limit-default

Conversation

@LALITH0110

Copy link
Copy Markdown

What do these changes do?

Correct the documented default for WebSocketResponse's writer_limit parameter in docs/web_reference.rst.

The reference documented it in two places:

  • the class signature, as writer_limit=65536
  • the parameter description, as "maximum size of write buffer, 64 KB by default"

The actual default in aiohttp/web_ws.py is writer_limit: int = DEFAULT_CHUNK_SIZE, and DEFAULT_CHUNK_SIZE is 2**18 in aiohttp/helpers.py — that is 262144 bytes, or 256 KiB. So the documented value understated the real default by a factor of four.

The signature now reads writer_limit=262144, matching how the neighbouring max_msg_size=4194304 is written, and the prose now says "256 KiB by default".

Documentation only — no code changes.

Are there changes in behavior for the user?

No. Nothing in the library changes. Users reading the docs to size a WebSocket write buffer will now see the value the code actually uses.

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

No. It is a two-line documentation correction with no ongoing maintenance cost.

Related issue number

None — found while comparing documented parameter defaults against the actual signatures.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist — N/A, documentation-only change
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
  • Add a new news fragment into the CHANGES/ folder

Drafted with Claude Opus 5; reviewed by @LALITH0110.

The reference documented `writer_limit` as `65536` in the class signature
and as "64 KB by default" in the parameter description, but the actual
default is `DEFAULT_CHUNK_SIZE`, which is `2**18` (262144 bytes, 256 KiB).

Readers sizing a WebSocket write buffer from the docs were working from a
value four times smaller than the real one.
@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided There is a change note present in this PR label Jul 31, 2026
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.98%. Comparing base (c3f07fc) to head (f0481e7).
⚠️ Report is 3 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #13294   +/-   ##
=======================================
  Coverage   98.98%   98.98%           
=======================================
  Files         132      132           
  Lines       49023    49023           
  Branches     2551     2551           
=======================================
  Hits        48526    48526           
  Misses        373      373           
  Partials      124      124           
Flag Coverage Δ
Autobahn 22.12% <ø> (ø)
CI-GHA 98.90% <ø> (ø)
OS-Linux 98.67% <ø> (ø)
OS-Windows 97.03% <ø> (ø)
OS-macOS 97.93% <ø> (-0.01%) ⬇️
Py-3.10 98.12% <ø> (+<0.01%) ⬆️
Py-3.11 98.37% <ø> (+<0.01%) ⬆️
Py-3.12 98.46% <ø> (+<0.01%) ⬆️
Py-3.13 98.44% <ø> (-0.01%) ⬇️
Py-3.14 98.45% <ø> (-0.01%) ⬇️
Py-3.14t 97.56% <ø> (ø)
Py-pypy-3.11 97.39% <ø> (-0.01%) ⬇️
VM-macos 97.93% <ø> (-0.01%) ⬇️
VM-ubuntu 98.67% <ø> (ø)
VM-windows 97.03% <ø> (ø)
cython-coverage 37.97% <ø> (ø)

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.

@codspeed-hq

codspeed-hq Bot commented Jul 31, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 84 untouched benchmarks
⏩ 83 skipped benchmarks1


Comparing LALITH0110:docs/websocketresponse-writer-limit-default (f0481e7) with master (c3f07fc)2

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.

  2. No successful run was found on master (9bb501f) during the generation of this report, so c3f07fc was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@LALITH0110
LALITH0110 marked this pull request as ready for review July 31, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant