[jira] [Commented] (GEODE-9725) AvailablePort inherently incompatible with default membership port range

2021-10-14 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-9725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17429053#comment-17429053
 ] 

ASF subversion and git services commented on GEODE-9725:


Commit 4a6b91717da35b7686c9f8644ead3ac041cf5a33 in geode's branch 
refs/heads/develop from Dale Emery
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=4a6b917 ]

GEODE-9725: Remove membership port range feature from AvailablePort (#6986)

`AvailablePort` and `AvailablePortHelper` have methods to retrieve an
"available" port from the membership port range. This feature is both
unnecessary and inherently unreliable.

INHERENTLY UNRELIABLE

The default membership port range overlaps each OS's ephemeral port
range. An ephemeral port deemed to be "available" by one of these
methods can be put into use by another process even before the method
returns. It is not safe to rely on such a port to remain available after
it is checked.

UNNECESSARY

Currently the only callers that request ports from the membership port
range are two tests in `DistributedSystemDUnitTest`. In each case, the
test uses the returned ports to *set* the membership port range for a
member. There is no need for the ports to come from any particular
range.

There are no other uses of this feature, either in the product or in
tests.

SOLUTION

Remove the "membership port range" feature from `AvailablePort` and
`AvailablePortHelper`.

Change `DistributedSystemDUnitTest` to get available ports from the
"available port range." This range is safe to use (assuming all other
concurrently-running tests are well-behaved).

> AvailablePort inherently incompatible with default membership port range
> 
>
> Key: GEODE-9725
> URL: https://issues.apache.org/jira/browse/GEODE-9725
> Project: Geode
>  Issue Type: Bug
>  Components: tests
>Affects Versions: 1.15.0
>Reporter: Dale Emery
>Assignee: Dale Emery
>Priority: Major
>  Labels: GeodeOperationAPI, pull-request-available
>
> {{AvailablePortHelperIntegrationTest}} failed in CI:
>  
> [https://concourse.apachegeode-ci.info/teams/main/pipelines/apache-develop-main/jobs/integration-test-openjdk8/builds/259]
> *Cause:* {{AvailablePort}} and {{AvailablePortHelper}} have methods to 
> retrieve an "available" port from the membership port range. This feature is 
> both unnecessary and inherently unreliable.
> *Inherently unreliable:* The default membership port range overlaps each OS's 
> ephemeral port range. An ephemeral port deemed to be "available" by one of 
> these methods can be put into use by another process even before the method 
> returns. It is not safe to rely on such a port to remain available after it 
> is checked.
> *Unnecessary:* Currently the only callers that request ports from the 
> membership port range are two tests in {{DistributedSystemDUnitTest}}. In 
> each case, the test uses the returned ports to +set+ the membership port 
> range for a member. There is no need for the ports to come from any 
> particular range.
> There are no other uses of this feature, either in the product or in tests.
> *Solution:* Remove this feature from {{AvailablePort}} and 
> {{AvailablePortHelper}}.
> *Alternatives:*
>  * {{DistributedSystemDUnitTest}} can get available ports from the available 
> port range. This range is safe to use (assuming all other 
> concurrently-running tests are well-behaved).
>  * A caller that needs ports in a specific range can call 
> {{AvailablePort.getRandomAvailablePortInRange(lower, upper, protocol)}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEODE-9725) AvailablePort inherently incompatible with default membership port range

2021-10-12 Thread Anthony Baker (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-9725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17427914#comment-17427914
 ] 

Anthony Baker commented on GEODE-9725:
--

Reviewed and removed triage label.

> AvailablePort inherently incompatible with default membership port range
> 
>
> Key: GEODE-9725
> URL: https://issues.apache.org/jira/browse/GEODE-9725
> Project: Geode
>  Issue Type: Bug
>  Components: tests
>Affects Versions: 1.15.0
>Reporter: Dale Emery
>Assignee: Dale Emery
>Priority: Major
>  Labels: GeodeOperationAPI, needsTriage, pull-request-available
>
> {{AvailablePortHelperIntegrationTest}} failed in CI:
>  
> [https://concourse.apachegeode-ci.info/teams/main/pipelines/apache-develop-main/jobs/integration-test-openjdk8/builds/259]
> *Cause:* {{AvailablePort}} and {{AvailablePortHelper}} have methods to 
> retrieve an "available" port from the membership port range. This feature is 
> both unnecessary and inherently unreliable.
> *Inherently unreliable:* The default membership port range overlaps each OS's 
> ephemeral port range. An ephemeral port deemed to be "available" by one of 
> these methods can be put into use by another process even before the method 
> returns. It is not safe to rely on such a port to remain available after it 
> is checked.
> *Unnecessary:* Currently the only callers that request ports from the 
> membership port range are two tests in {{DistributedSystemDUnitTest}}. In 
> each case, the test uses the returned ports to +set+ the membership port 
> range for a member. There is no need for the ports to come from any 
> particular range.
> There are no other uses of this feature, either in the product or in tests.
> *Solution:* Remove this feature from {{AvailablePort}} and 
> {{AvailablePortHelper}}.
> *Alternatives:*
>  * {{DistributedSystemDUnitTest}} can get available ports from the available 
> port range. This range is safe to use (assuming all other 
> concurrently-running tests are well-behaved).
>  * A caller that needs ports in a specific range can call 
> {{AvailablePort.getRandomAvailablePortInRange(lower, upper, protocol)}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)