Skip to content

ZOOKEEPER-4377: KeeperException.create NPE for unknown error codes (backport) - #168

Merged
arkmish merged 1 commit into
armishra/zookeeper-3301-quota-enforcementfrom
armishra/zookeeper-4377-unknown-error-code
Oct 19, 2026
Merged

arkmish merged 1 commit into
armishra/zookeeper-3301-quota-enforcementfrom
armishra/zookeeper-4377-unknown-error-code

Conversation

@arkmish

@arkmish arkmish commented Oct 19, 2026

Copy link
Copy Markdown

Description

Stack 3/3: mirrors upstream ZOOKEEPER-4377 (apache/zookeeper@9f355f5a5, released in 3.5.10 / 3.7.1 / 3.8.0). This PR is based on the ZOOKEEPER-4219 PR.

Before this change, a client that received an error code it did not know (for example, a newer server's error) hit an NPE inside KeeperException.create. Now Code.get throws IllegalArgumentException("The current client version cannot lookup this code:<code>"), and the default message includes the code. This matters for the -128 code added in this stack.

Tests

  • KeeperExceptionQuotaTest.testUnknownWireErrorIsExplicit.
  • Local run of the full stack: 195 tests passed. Full reactor test-compile and Checkstyle passed.

Changes that Break Backward Compatibility (Optional)

Code.get throws IllegalArgumentException for unknown codes instead of returning null.

Documentation (Optional)

Updated the JIRA list in zookeeperQuotas.md.

  • Local code review completed

Created with GitHub Copilot CLI.

…low version client requests the high version server

Backport of apache/zookeeper 9f355f5 (released in 3.5.10/3.7.1/3.8.0).

Code.get throws IllegalArgumentException for unknown codes and
KeeperException.create reports the code, instead of an NPE.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Base automatically changed from armishra/zookeeper-4219-quota-multi-setdata to armishra/zookeeper-3301-quota-enforcement October 19, 2026 14:53
@arkmish
arkmish merged commit 40002b6 into armishra/zookeeper-3301-quota-enforcement Oct 19, 2026
16 checks passed
@arkmish
arkmish deleted the armishra/zookeeper-4377-unknown-error-code branch October 19, 2026 14:53
@arkmish

arkmish commented Oct 19, 2026

Copy link
Copy Markdown
Author

Folded into #166, which now carries all three backport commits. This PR shows as merged only because its commits became part of the stacked base branch; nothing was merged into branch-3.6.

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.

1 participant