Skip to content

Socket tests: don't retry CanceledByDispose tests on timeout - #42725

Closed
tmds wants to merge 4 commits into
dotnet:masterfrom
tmds:canceledbydispose_timeout
Closed

Socket tests: don't retry CanceledByDispose tests on timeout#42725
tmds wants to merge 4 commits into
dotnet:masterfrom
tmds:canceledbydispose_timeout

Conversation

@tmds

@tmds tmds commented Sep 25, 2020

Copy link
Copy Markdown
Member

These retries cause masking cases where the operation and
dispose Task are never completing.

Fixes #42686 (comment)

@MihaZupan @antonfirsov ptal

These retries cause masking cases where the operation and
dispose Task are never completing.
@ghost

ghost commented Sep 25, 2020

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

@antonfirsov antonfirsov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wouldn't it be better to extend RetryHelper to detect fatal failures?

See:
1339f52

int msDelay = 100;
await RetryHelper.ExecuteAsync(async () =>
int retries = 10;
while (true)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

                catch (SocketException se)
                {
                    // On connection timeout, retry.
                    Assert.NotEqual(SocketError.TimedOut, se.SocketErrorCode);

                    localSocketError = se.SocketErrorCode;
                }

The test fails here on Windows. Should do some more research on SocketError.TimedOut cases, but I think we should keep retrying here.

@antonfirsov

Copy link
Copy Markdown
Contributor

Fixes #42686 (comment)

I don't think that a possible test bug is the only concern in #42686.

@tmds

tmds commented Sep 29, 2020

Copy link
Copy Markdown
Member Author

I don't think that a possible test bug is the only concern in #42686.

Yes, this is only meant to fix the test bug.

Comment thread src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ssl.c Outdated
@antonfirsov

antonfirsov commented Oct 6, 2020

Copy link
Copy Markdown
Contributor

@tmds what do you think about my idea regarding RetryHelper? If we could simplify the changes with that trick, and fix the Windows failure, I'm happy to proceed merging this.

@tmds

tmds commented Oct 6, 2020

Copy link
Copy Markdown
Member Author

@tmds what do you think about my idea regarding RetryHelper? If we could simplify the changes with that trick, and fix the Windows failure, I'm happy to proceed merging this.

I think you need to look at multiple tests to know whether it makes sense to extend the RetryHelper for this pattern.
I've moved the assert into the try-catch-retry section. It was the simplest way to fix the Windows failure.

@antonfirsov

Copy link
Copy Markdown
Contributor

/azp run runtime

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@antonfirsov

Copy link
Copy Markdown
Contributor

/azp run runtime

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@antonfirsov

Copy link
Copy Markdown
Contributor

/azp run runtime

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@tmds

tmds commented Oct 15, 2020

Copy link
Copy Markdown
Member Author

Part of #42725.

@tmds tmds closed this Oct 15, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
@karelz karelz added this to the 6.0.0 milestone Jan 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Socket Dispose during synchronous operation hangs on RedHat 7

4 participants