Skip to content

Avoid reusing released APIServer response buffers - #273

Merged
popduke merged 1 commit into
apache:mainfrom
MrlixiangWE:fix-272-apiserver-response-buffers
Aug 12, 2026
Merged

Avoid reusing released APIServer response buffers#273
popduke merged 1 commit into
apache:mainfrom
MrlixiangWE:fix-272-apiserver-response-buffers

Conversation

@MrlixiangWE

Copy link
Copy Markdown
Contributor

Fixes #272.

PubHandler and KillHandler previously reused static reference-counted ByteBuf instances for validation-error responses. Once Netty released the first response, the same validation path could receive content with refCnt == 0.

This change keeps the error text as static immutable strings and creates an independently owned UTF-8 buffer for every response. The regression tests release the first response before exercising the same path again and cover all five affected validation responses.

Tests:

  • ./mvnw -q -pl bifromq-apiserver -Dtest=PubHandlerTest,KillHandlerTest test
  • ./mvnw -q -pl bifromq-apiserver test
  • ./mvnw -q -pl bifromq-apiserver checkstyle:check
  • ./mvnw -q test

@popduke
popduke merged commit e7287fa into apache:main Aug 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] APIServer reuses released ByteBufs for validation error responses

2 participants