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 — FlowControlHandler must provide an ensured message for each read request · Issue #17050 · netty/netty

FlowControlHandler must provide an ensured message for each read request #17050

New issue
Copy link
New issue
Copy link
Open
#17046
Open
FlowControlHandler must provide an ensured message for each read request#17050
#17046
Copy link

Description

@ursaj
ursaj
opened on Jul 3, 2026
Issue body actions

The first line in FlowControlHandler (FCH) documentation states the following:

* The {@link FlowControlHandler} ensures that only one message per {@code read()} is sent downstream.

Two key points here: (a) ensures and (b) one message per read().

If FCH triggers read-complete event BEFORE requested message delivered, then we'll face a breach of this contract.

Worse part – to initiate the next read-cycle we will be forced to invoke read() the second time, thus according to (b) part of the contract we should get 2 messages eventually, even though we need only the first one. The problems scales with time and the number of messages handled.

This is why FCH must trigger read-complete event (channelReadComplete()) only and only after ALL requested messages (read() invocations) are delivered (channelRead() invocations).

Though, we have an edge case – auto-read enabled. Current implementation behaves as follows:

  • overflow messages are delivered immediately regardless of read() requests from downstream;
  • there is no control on read-complete events, these events are delivered in a pass-through manner.

Messages overflow behaviour is in-line with the main contract, read() requests are implicit:

  • after all requested message are delivered we should check auto-read, if enabled - assume the next read-cycle activated, if disabled - halt queue processing and await for the next explicit read() call from downstream or channelRead() / channelReadComplete() events from upstream.

However uncontrolled read-complete events look like a breach of contract. Implicit read() is still a message request, thus read-complete event MUST be triggered only and only after POSITIVE (1+) number of messages is actually delivered.

Recent bugfix #16837 should have fixed duplicate read-complete events. In essence - if we haven't requested anything (read() calls), then there should be NO read-complete events.

TL;DR:

  • no read() requests – no channelRead() / channelReadComplete() events,
  • any sequence of N x read() requests where N >= 1 MUST lead to exactly N x channelRead() + 1 x channelReadComplete() events;
  • auto-read=enabled MUST comply with this rule, assuming an implicit read() was called whenever needed.
Reacted by Daniel Flower, Jay Lu and Adwait Kumar Singh

Activity

  1. ursaj
    added 2 commits that reference this issue on Jul 4, 2026

    Ensure no read-complete duplicate events triggered when `autoRead=tru…

    82b1644

    Ensure no read-complete duplicate events triggered when `autoRead=tru…

    57c5302
  2. ursaj
    added 2 commits that reference this issue on Nov 13, 2026

    FlowControlHandler must comply with its fundamental goal (ensured mes…

    c8cbfa1

    FlowControlHandler must comply with its fundamental goal (ensured mes…

    9777382
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      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.