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 — netty-chunked-write-issue/README.md at main · cfolgere/netty-chunked-write-issue

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
62 lines (43 loc) · 1.59 KB
/

README.md

Copy path

File metadata and controls

62 lines (43 loc) · 1.59 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Netty ChunkedWriteHandler Direct Memory Reproducer

This standalone Maven project demonstrates the ChunkedWriteHandler queue-drain behavior difference between Netty 4.1.104.Final and 4.1.105.Final.

The test writes an HTTP response and content chunks through:

ChunkedWriteHandler -> HttpResponseEncoder -> DirectBufferingOutboundHandler

It intentionally does not call flush() until after all writes are queued.

  • With Netty 4.1.104.Final, response bytes remain queued before flush(), so the test passes.
  • With Netty 4.1.105.Final, response bytes reach the downstream direct-buffer staging handler before flush(), so the test fails and reports staged bytes plus pooled direct-memory growth.

Reproduce The Old Behavior

Run the test against Netty 4.1.104.Final:

mvn -q test -Dnetty.version=4.1.104.Final

Expected result: the test passes.

Reproduce The Behavior Change

Run the same test against Netty 4.1.105.Final:

mvn -q test -Dnetty.version=4.1.105.Final

Expected result: the test fails before flush() with a message similar to:

response bytes reached downstream direct-buffer staging before flush;
pendingBytes=2097196, usedDirectMemoryBefore=0, usedDirectMemoryAfterWrites=2228224

Optional Version Matrix

Run the same test against several Netty versions:

for version in 4.1.104.Final 4.1.105.Final 4.1.110.Final 4.1.136.Final; do
  echo "### Netty ${version}"
  mvn -q test -Dnetty.version="${version}"
  echo
done

Expected results:

4.1.104.Final: pass
4.1.105.Final: fail
4.1.110.Final: fail
4.1.136.Final: fail
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.