Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searching for Ports 1,000 at a Time can Result in "Invalid port exception" #35

Open
Kortanul opened this issue Apr 18, 2019 · 0 comments
Assignees
Labels
version:3.x Issues that apply to Wren:DS 3.x. version:4.x Issues that apply to Wren:DS 4.x.

Comments

@Kortanul
Copy link
Member

Kortanul commented Apr 18, 2019

Summary

Wren:DS SDK defines a PORT_INCREMENT value of 1000, which means that if a port it wants to use is in-use, it skips 1,000 ports at a time until it can find the desired port. This can lead to failures during test runs if the port number the OS hands to the test is close to the maximum port number (e.g. max is 65535 and starting port number is 64536).

At run-time, presumably this issue is less severe because Wren:DS has no preference for starting port number, so it has a larger pool of addresses to search 1,000 at a time. This defect only appears when the starting port # is within a few thousand port numbers of the RFC-defined max port #.

Steps To Reproduce ("Repro Steps")

NOTE: These steps do not reliably reproduce the issue because the issue depends on what ports are available on the host machine.

  1. Checkout Wren:DS @ 9e5a6fa.
  2. Build the project with mvn clean install.

Expected Result (Behavior You Expected to See)

The build should succeed with no test failures.

Actual Result (Behavior You Saw)

Sporadically, tests may fail with an IllegalArgumentException and message of "Invalid port.".

Environment

  • Product version (include GIT commit ID if using a dev build): 3.0.0 @ 9e5a6fa
  • Operating system:
    Ubuntu 18.04.1 LTS
    Linux 4.4.0-17763-Microsoft #379-Microsoft Wed Mar 06 19:16:00 PST 2019 x86_64 x86_64 x86_64 GNU/Linux
    
  • JRE version:
    openjdk version "1.8.0_191"
    OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.18.04.1-b12)
    OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
    
  • Was instance upgraded from a previous version? If so, what version were you using before?
    No.
@Kortanul Kortanul changed the title [All versions] Searching for Ports 1,000 at a Time can Result in "Invalid port exception" [3.0, 4.0] Searching for Ports 1,000 at a Time can Result in "Invalid port exception" Apr 18, 2019
@Kortanul Kortanul added version:3.x Issues that apply to Wren:DS 3.x. version:4.x Issues that apply to Wren:DS 4.x. labels Apr 18, 2019
@Kortanul Kortanul changed the title [3.0, 4.0] Searching for Ports 1,000 at a Time can Result in "Invalid port exception" Searching for Ports 1,000 at a Time can Result in "Invalid port exception" Apr 18, 2019
@Kortanul Kortanul self-assigned this Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version:3.x Issues that apply to Wren:DS 3.x. version:4.x Issues that apply to Wren:DS 4.x.
Projects
None yet
Development

No branches or pull requests

1 participant