GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Respect max messages per read in LocalServerChannel (#17255) by normanmaurer · Pull Request #17269 · netty/netty

Conversation

@normanmaurer

@normanmaurer normanmaurer commented Aug 12, 2026

Copy link
Copy Markdown
Member

Motivation:

LocalServerChannel resets a RecvByteBufAllocator.Handle and consults
continueReading() in its accept loop, but it never increments the
handle's message count. Since ServerChannelRecvByteBufAllocator
ignores byte counts, totalMessages remains zero and queued connections
are drained in one read cycle regardless of maxMessagesPerRead.

This restores the read-limit behavior originally addressed by #7885,
which became observable again after #11729 introduced the server-channel
allocator.

Modification:

  • Increment the receive handle's message count for every accepted local
    connection.
  • Add a regression test that queues five connections with auto-read
    disabled, enables auto-read with a limit of two, and verifies read-cycle
    sizes of 2, 2, and 1.

Result:

LocalServerChannel now respects the configured maximum messages per
read while continuing to deliver remaining queued connections in
subsequent read cycles.

Validation:

  • ./mvnw -pl transport -Dtest=io.netty.channel.local.LocalChannelTest#testServerMaxMessagesPerReadRespectedWithQueuedConnections test
  • ./mvnw -pl transport -Dtest=io.netty.channel.local.LocalChannelTest test — 27 tests passed
  • ./mvnw -pl transport test — 391 tests passed, 9 skipped

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Gimini-3 @normanmaurer
Respect max messages per read in LocalServerChannel (#17255)
719b3e0
Motivation:

`LocalServerChannel` resets a `RecvByteBufAllocator.Handle` and consults
`continueReading()` in its accept loop, but it never increments the
handle's message count. Since `ServerChannelRecvByteBufAllocator`
ignores byte counts, `totalMessages` remains zero and queued connections
are drained in one read cycle regardless of `maxMessagesPerRead`.

This restores the read-limit behavior originally addressed by #7885,
which became observable again after #11729 introduced the server-channel
allocator.

Modification:

- Increment the receive handle's message count for every accepted local
connection.
- Add a regression test that queues five connections with auto-read
disabled, enables auto-read with a limit of two, and verifies read-cycle
sizes of 2, 2, and 1.

Result:

`LocalServerChannel` now respects the configured maximum messages per
read while continuing to deliver remaining queued connections in
subsequent read cycles.

Validation:

- `./mvnw -pl transport
-Dtest=io.netty.channel.local.LocalChannelTest#testServerMaxMessagesPerReadRespectedWithQueuedConnections
test`
- `./mvnw -pl transport -Dtest=io.netty.channel.local.LocalChannelTest
test` — 27 tests passed
- `./mvnw -pl transport test` — 391 tests passed, 9 skipped
@normanmaurer normanmaurer mentioned this pull request Aug 12, 2026
Respect max messages per read in LocalServerChannel #17255
Merged
@normanmaurer
Fix
3b97ae1
@normanmaurer normanmaurer added this to the 4.1.138.Final milestone Aug 12, 2026
@normanmaurer
normanmaurer merged commit 583072d into 4.1 Aug 12, 2026
17 of 18 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
normanmaurer deleted the read_41 branch August 12, 2026 13:36
@lhotari lhotari mentioned this pull request Sep 10, 2026
[fix][sec][branch-4.x] Upgrade Netty to 4.1.138 to address several CVEs and bugs apache/pulsar#26515
Merged
2 of 11 tasks
lltopk pushed a commit to lltopk/netty that referenced this pull request Oct 24, 2026
@normanmaurer @Gimini-3 @lltopk
Respect max messages per read in LocalServerChannel (netty#17255) (ne…
f5ceb24
…tty#17269)

Motivation:

`LocalServerChannel` resets a `RecvByteBufAllocator.Handle` and consults
`continueReading()` in its accept loop, but it never increments the
handle's message count. Since `ServerChannelRecvByteBufAllocator`
ignores byte counts, `totalMessages` remains zero and queued connections
are drained in one read cycle regardless of `maxMessagesPerRead`.

This restores the read-limit behavior originally addressed by netty#7885,
which became observable again after netty#11729 introduced the server-channel
allocator.

Modification:

- Increment the receive handle's message count for every accepted local
connection.
- Add a regression test that queues five connections with auto-read
disabled, enables auto-read with a limit of two, and verifies read-cycle
sizes of 2, 2, and 1.

Result:

`LocalServerChannel` now respects the configured maximum messages per
read while continuing to deliver remaining queued connections in
subsequent read cycles.

Validation:

- `./mvnw -pl transport

-Dtest=io.netty.channel.local.LocalChannelTest#testServerMaxMessagesPerReadRespectedWithQueuedConnections
test`
- `./mvnw -pl transport -Dtest=io.netty.channel.local.LocalChannelTest
test` — 27 tests passed
- `./mvnw -pl transport test` — 391 tests passed, 9 skipped

---------

Co-authored-by: Gimin Kim <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

4.1.138.Final

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@normanmaurer @Gimini-3
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.