Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1003,8 +1003,9 @@ public async Task TcpReceiveSendGetsCanceledByDispose(bool receiveOrSend, bool i
{
// RHEL7 kernel has a bug preventing close(AF_UNKNOWN) to succeed with IPv6 sockets.
// In this case Dispose will trigger a graceful shutdown, which means that receive will succeed on socket2.
// This bug is fixed in kernel 3.10.0-1160.25+.
// TODO: Remove this, once CI machines are updated to a newer kernel.
bool expectGracefulShutdown = UsesSync && PlatformDetection.IsRedHatFamily7 && receiveOrSend && (ipv6Server || dualModeClient);
bool mayShutdownGraceful = UsesSync && PlatformDetection.IsRedHatFamily7 && receiveOrSend && (ipv6Server || dualModeClient);

// We try this a couple of times to deal with a timing race: if the Dispose happens
// before the operation is started, the peer won't see a ConnectionReset SocketException and we won't
Expand Down Expand Up @@ -1092,17 +1093,17 @@ await RetryHelper.ExecuteAsync(async () =>
}
}

if (!expectGracefulShutdown)
try
{
Assert.Equal(SocketError.ConnectionReset, peerSocketError);
}
else
catch when (mayShutdownGraceful)
{
Assert.Null(peerSocketError);
}
}
}
}, maxAttempts: 10, retryWhen: e => e is XunitException);
}, maxAttempts: 8, retryWhen: e => e is XunitException);
}

[Fact]
Expand Down