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

Stop udp connection allocation test hanging on linux. #1578

Merged
merged 1 commit into from Jun 29, 2020

Conversation

PeterAdams-A
Copy link
Contributor

Motivation:

Hanging tests make doing work and asserting correctness very difficult.

Modifications:

Remove address reuse from the server side of the udp channel.

Result:

The tests no longer hang.

(The reason things we hanging was that the client side was occasionally getting assigned the same port number as the server side (extremely agressive port reuse)

Motivation:

Hanging tests make doing work and asserting correctness very difficult.

Modifications:

Remove address reuse from the server side of the udp channel.

Result:

The tests no longer hang.

(The reason things we hanging was that the client side was occasionally getting assigned the same port number as the server side (extremely agressive port reuse)
@@ -44,7 +44,6 @@ func run(identifier: String) {
let serverHandler = CountReadsHandler(numberOfReadsExpected: numberOfIterations,
completionPromise: group.next().makePromise())
let serverChannel = try! DatagramBootstrap(group: group)
.channelOption(ChannelOptions.socketOption(.so_reuseaddr), value: 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we want to disable this on the client?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, the server is where it should be disabled. Given that we were binding to 0 there was never any real advantage in having SO_REUSEADDR turned on in this test anyway.

@Lukasa Lukasa added the patch-version-bump-only For PRs that when merged will only cause a bump of the patch version, ie. 1.0.x -> 1.0.(x+1) label Jun 29, 2020
@Lukasa Lukasa added this to the 2.19.0 milestone Jun 29, 2020
@@ -44,7 +44,6 @@ func run(identifier: String) {
let serverHandler = CountReadsHandler(numberOfReadsExpected: numberOfIterations,
completionPromise: group.next().makePromise())
let serverChannel = try! DatagramBootstrap(group: group)
.channelOption(ChannelOptions.socketOption(.so_reuseaddr), value: 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, the server is where it should be disabled. Given that we were binding to 0 there was never any real advantage in having SO_REUSEADDR turned on in this test anyway.

@Lukasa Lukasa merged commit 16b9dd6 into apple:master Jun 29, 2020
slashmo pushed a commit to slashmo/swift-nio that referenced this pull request Aug 18, 2020
Motivation:

Hanging tests make doing work and asserting correctness very difficult.

Modifications:

Remove address reuse from the server side of the udp channel.

Result:

The tests no longer hang.

(The reason things we hanging was that the client side was occasionally getting assigned the same port number as the server side (extremely agressive port reuse)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch-version-bump-only For PRs that when merged will only cause a bump of the patch version, ie. 1.0.x -> 1.0.(x+1)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants