Skip to content

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

Open
ennuite wants to merge 3 commits into
apache:mainfrom
ennuite:remove-port-zero
Open

GH-1271: [Flight] Reject port 0 in NettyClientBuilder#1282
ennuite wants to merge 3 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

Copy link
Copy Markdown

Thank you for opening a pull request!

Please label the PR with one or more of:

  • bug-fix
  • chore
  • dependencies
  • documentation
  • enhancement

Also, add the 'breaking-change' label if appropriate.

See CONTRIBUTING.md for details.

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.

[Flight] Reject port 0 in NettyClientBuilder

1 participant