GH-1271: [Flight] Reject port 0 in NettyClientBuilder - #1282
Open
ennuite wants to merge 3 commits into
Open
Conversation
… 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
requested review from
jbonofre,
laurentgo,
lidavidm and
wgtmac
as code owners
August 31, 2026 15:21
ennuite
marked this pull request as draft
August 31, 2026 15:21
ennuite
marked this pull request as ready for review
August 31, 2026 15:30
Contributor
Author
|
No need from my side to add this one to release 20.0.0 It needs the enhancement label. |
|
Thank you for opening a pull request! Please label the PR with one or more of:
Also, add the 'breaking-change' label if appropriate. See CONTRIBUTING.md for details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.testUnencryptedConnectionProvidingInvalidPortwas 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.