Skip to content

GH-1271: [Flight] Reject port 0 in NettyClientBuilder - #1282

Merged
jbonofre merged 4 commits into
apache:mainfrom
ennuite:remove-port-zero
Sep 6, 2026
Merged

GH-1271: [Flight] Reject port 0 in NettyClientBuilder#1282
jbonofre merged 4 commits into
apache:mainfrom
ennuite:remove-port-zero

Conversation

@ennuite

@ennuite ennuite commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

What's changed

Port validation in NettyClientBuilder.build() is tightened to explicitly disallow port 0, as it is not a valid destination port number for a client.
Tests that made use of port 0 were updated to use a valid port under the new validation.

Are these changes tested?

Yes. ConnectionTest.testUnencryptedConnectionProvidingInvalidPort was expanded to cover more invalid ports, including port 0.

This change was created with AI assistance (Claude Code). All lines were manually reviewed by a human. The output is not copyrightable subject matter.

Closes #1271.

ennuite and others added 3 commits August 31, 2026 16:19
… omitted port

Tighten the port validation to 1–65535 (port 0 is reserved and invalid
for client connections). Four builder-based tests were not calling
withPort() at all, so the port field defaulted to 0 and slipped through
unnoticed before the validation was added. Each test now passes the
actual test-server port via FLIGHT_SERVER_TEST_EXTENSION.getPort().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Converts testUnencryptedConnectionProvidingInvalidPort to a
@ParameterizedTest covering 0, -1, 65536, and 65537, explicitly
exercising the port-0 rejection added to NettyClientBuilder.build().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ennuite
ennuite marked this pull request as draft August 31, 2026 15:21
@ennuite ennuite changed the title GH-1271: Reject port 0 in NettyClientBuilder and fix tests that omitted port GH-1271: [Flight] Reject port 0 in NettyClientBuilder Aug 31, 2026
@ennuite
ennuite marked this pull request as ready for review August 31, 2026 15:30
@ennuite

ennuite commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

No need from my side to add this one to release 20.0.0

It needs the enhancement label.

@github-actions

This comment has been minimized.

@jbonofre jbonofre added the enhancement PRs that add or improve features. label Sep 1, 2026
@jbonofre jbonofre added this to the 20.0.0 milestone Sep 1, 2026

@jbonofre jbonofre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM to now!

@jbonofre
jbonofre merged commit ed01421 into apache:main Sep 6, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement PRs that add or improve features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Flight] Reject port 0 in NettyClientBuilder

2 participants