You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "rtadepalli (via GitHub)" <gi...@apache.org> on 2023/02/02 00:08:22 UTC

[GitHub] [arrow] rtadepalli opened a new pull request, #33992: GH-32954: [Java] Let OS assign port in tests while creating Flight server

rtadepalli opened a new pull request, #33992:
URL: https://github.com/apache/arrow/pull/33992

   <!--
   Thanks for opening a pull request!
   If this is your first pull request you can find detailed information on how 
   to contribute here:
     * [New Contributor's Guide](https://arrow.apache.org/docs/dev/developers/guide/step_by_step/pr_lifecycle.html#reviews-and-merge-of-the-pull-request)
     * [Contributing Overview](https://arrow.apache.org/docs/dev/developers/overview.html)
   
   
   If this is not a [minor PR](https://github.com/apache/arrow/blob/master/CONTRIBUTING.md#Minor-Fixes). Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose
   
   Opening GitHub issues ahead of time contributes to the [Openness](http://theapacheway.com/open/#:~:text=Openness%20allows%20new%20users%20the,must%20happen%20in%20the%20open.) of the Apache Arrow project.
   
   Then could you also rename the pull request title in the following format?
   
       GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
   
   or
   
       MINOR: [${COMPONENT}] ${SUMMARY}
   
   In the case of PARQUET issues on JIRA the title also supports:
   
       PARQUET-${JIRA_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
   
   -->
   
   ### Rationale for this change
   
   Sometimes tests are flaky because the current port selection algorithm selects a random port between the ranges 49152-54152. This change makes it such that the OS will assign the next free port without us searching for a port in this range.
   
   ### What changes are included in this PR?
   
   This PR makes use of  `java.net.ServerSocket`'s ability to assign the next free port if 0 is passed as the port number.
   
   ### Are these changes tested?
   
   If existing tests pass, there's confirmation that the Flight server is able to come up successfully, thereby no new tests should be needed.
   
   ### Are there any user-facing changes?
   
   No, there are no user facing changes.
   
   <!--
   If there are any breaking changes to public APIs, please uncomment the line below and explain which changes are breaking.
   -->
   <!-- **This PR includes breaking changes to public APIs.** -->
   
   <!--
   Please uncomment the line below (and provide explanation) if the changes fix either (a) a security vulnerability, (b) a bug that caused incorrect or invalid data to be produced, or (c) a bug that causes a crash (even when the API contract is upheld). We use this to highlight fixes to issues that may affect users without their knowledge. For this reason, fixing bugs that cause errors don't count, since those are usually obvious.
   -->
   <!-- **This PR contains a "Critical Fix".** -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] ursabot commented on pull request #33992: GH-33993: [Java] Let OS assign port in tests while creating Flight server

Posted by "ursabot (via GitHub)" <gi...@apache.org>.
ursabot commented on PR #33992:
URL: https://github.com/apache/arrow/pull/33992#issuecomment-1414116266

   ['Python', 'R'] benchmarks have high level of regressions.
   [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/f49ffe82fec441239851e4e20cc0b580...7d6340037d464279a32aeb84e014b0ba/)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] lidavidm commented on pull request #33992: GH-32954: [Java] Let OS assign port in tests while creating Flight server

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on PR #33992:
URL: https://github.com/apache/arrow/pull/33992#issuecomment-1412935843

   Thank you! That said, the issue is actually about getting rid of this antipattern entirely - we can and should bind to port 0 directly, and create the client by reading the assigned port off of the server. (That's why the issue is about getting rid of the antipattern-using test utilities).
   
   This is an improvement though, so we can just file a new issue for this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] lidavidm commented on a diff in pull request #33992: GH-33993: [Java] Let OS assign port in tests while creating Flight server

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #33992:
URL: https://github.com/apache/arrow/pull/33992#discussion_r1093893857


##########
java/flight/flight-core/src/test/java/org/apache/arrow/flight/FlightTestUtil.java:
##########
@@ -51,7 +52,10 @@ public static <T> T getStartedServer(Function<Location, T> newServerFromLocation
     IOException lastThrown = null;
     T server = null;
     for (int x = 0; x < 3; x++) {
-      final int port = 49152 + RANDOM.nextInt(5000);
+      final ServerSocket dynamicPortSocket = new ServerSocket(0);

Review Comment:
   nit: maybe try-with-resources this just to be safe?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] rtadepalli commented on a diff in pull request #33992: GH-32954: [Java] Let OS assign port in tests while creating Flight server

Posted by "rtadepalli (via GitHub)" <gi...@apache.org>.
rtadepalli commented on code in PR #33992:
URL: https://github.com/apache/arrow/pull/33992#discussion_r1093868784


##########
java/flight/flight-core/src/test/java/org/apache/arrow/flight/FlightTestUtil.java:
##########
@@ -51,7 +52,10 @@ public static <T> T getStartedServer(Function<Location, T> newServerFromLocation
     IOException lastThrown = null;
     T server = null;
     for (int x = 0; x < 3; x++) {

Review Comment:
   Kept the retry in case the port gets before the lambda is applied and the server is created.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] lidavidm commented on pull request #33992: GH-33993: [Java] Let OS assign port in tests while creating Flight server

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on PR #33992:
URL: https://github.com/apache/arrow/pull/33992#issuecomment-1412985541

   No worries, as mentioned this is still better than it was before.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] rtadepalli commented on pull request #33992: GH-32954: [Java] Let OS assign port in tests while creating Flight server

Posted by "rtadepalli (via GitHub)" <gi...@apache.org>.
rtadepalli commented on PR #33992:
URL: https://github.com/apache/arrow/pull/33992#issuecomment-1412941176

   I have created: https://github.com/apache/arrow/issues/33993
   
   Will amend my commit to include the new issue number.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] github-actions[bot] commented on pull request #33992: GH-33993: [Java] Let OS assign port in tests while creating Flight server

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #33992:
URL: https://github.com/apache/arrow/pull/33992#issuecomment-1412942635

   :warning: GitHub issue #33993 **has been automatically assigned in GitHub** to PR creator.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] github-actions[bot] commented on pull request #33992: GH-33993: [Java] Let OS assign port in tests while creating Flight server

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #33992:
URL: https://github.com/apache/arrow/pull/33992#issuecomment-1412942569

   * Closes: #33993


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] ursabot commented on pull request #33992: GH-33993: [Java] Let OS assign port in tests while creating Flight server

Posted by "ursabot (via GitHub)" <gi...@apache.org>.
ursabot commented on PR #33992:
URL: https://github.com/apache/arrow/pull/33992#issuecomment-1414115981

   Benchmark runs are scheduled for baseline = b413ac4f2b6911af5e8241803277caccc43aa3c4 and contender = a0d0ecee71b99b45f2c1b269c70033d39b982d00. a0d0ecee71b99b45f2c1b269c70033d39b982d00 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/ccd2665f7a224aa78f8e545a30f01399...04072879a3b04626880d558118590b57/)
   [Failed :arrow_down:0.55% :arrow_up:0.0%] [test-mac-arm](https://conbench.ursa.dev/compare/runs/386b1a6062104a93a58ac539859e8362...2e6ba3c9abb040f6b3c799aedd9f0e84/)
   [Finished :arrow_down:1.79% :arrow_up:0.0%] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/f49ffe82fec441239851e4e20cc0b580...7d6340037d464279a32aeb84e014b0ba/)
   [Finished :arrow_down:0.13% :arrow_up:0.0%] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/8f88bbf4942b41c9b9e53395b8da3f2f...bc9c1705b9424d529b8de2a94d0a1618/)
   Buildkite builds:
   [Finished] [`a0d0ecee` ec2-t3-xlarge-us-east-2](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ec2-t3-xlarge-us-east-2/builds/2309)
   [Failed] [`a0d0ecee` test-mac-arm](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/2335)
   [Finished] [`a0d0ecee` ursa-i9-9960x](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-i9-9960x/builds/2306)
   [Finished] [`a0d0ecee` ursa-thinkcentre-m75q](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-thinkcentre-m75q/builds/2327)
   [Finished] [`b413ac4f` ec2-t3-xlarge-us-east-2](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ec2-t3-xlarge-us-east-2/builds/2308)
   [Failed] [`b413ac4f` test-mac-arm](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/2334)
   [Finished] [`b413ac4f` ursa-i9-9960x](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-i9-9960x/builds/2305)
   [Finished] [`b413ac4f` ursa-thinkcentre-m75q](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-thinkcentre-m75q/builds/2326)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] rtadepalli commented on pull request #33992: GH-32954: [Java] Let OS assign port in tests while creating Flight server

Posted by "rtadepalli (via GitHub)" <gi...@apache.org>.
rtadepalli commented on PR #33992:
URL: https://github.com/apache/arrow/pull/33992#issuecomment-1412937396

   Yeah I was thinking that this is somewhat of a dumb fix to what you mentioned in the ticket. Sure, I can file a new ticket for this. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] github-actions[bot] commented on pull request #33992: GH-32954: [Java] Let OS assign port in tests while creating Flight server

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #33992:
URL: https://github.com/apache/arrow/pull/33992#issuecomment-1412934378

   :warning: GitHub issue #32954 **has been automatically assigned in GitHub** to PR creator.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] github-actions[bot] commented on pull request #33992: GH-32954: [Java] Let OS assign port in tests while creating Flight server

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #33992:
URL: https://github.com/apache/arrow/pull/33992#issuecomment-1412934335

   * Closes: #32954


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] rtadepalli commented on pull request #33992: GH-33993: [Java] Let OS assign port in tests while creating Flight server

Posted by "rtadepalli (via GitHub)" <gi...@apache.org>.
rtadepalli commented on PR #33992:
URL: https://github.com/apache/arrow/pull/33992#issuecomment-1412944924

   @lidavidm I'd like to work on the original ticket as well. Hopefully I'll have something up soon. Sorry about the confusion here.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] lidavidm merged pull request #33992: GH-33993: [Java] Let OS assign port in tests while creating Flight server

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm merged PR #33992:
URL: https://github.com/apache/arrow/pull/33992


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org