-
Notifications
You must be signed in to change notification settings - Fork 5k
Do not rethrow from SocketsTestServerAPM.OnAccept #114964
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
Do not rethrow from SocketsTestServerAPM.OnAccept #114964
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes issue #85666 by preventing rethrows in the SocketTestServerAPM.OnAccept method to avoid test process crashes.
- Removed rethrows from two SocketException catch blocks
- Simplified exception handling to ensure the recursive OnAccept loop exits gracefully
Comments suppressed due to low confidence (2)
src/libraries/Common/tests/System/Net/Sockets/SocketTestServerAPM.cs:54
- Consider adding a comment in this catch block to explain that swallowing the exception is intentional to prevent process crashes during continuous accepts.
throw;
src/libraries/Common/tests/System/Net/Sockets/SocketTestServerAPM.cs:78
- Consider adding a comment in this catch block to clarify that omitting the rethrow is intentional as part of the fix for test process crashes.
throw;
src/libraries/Common/tests/System/Net/Sockets/SocketTestServerAPM.cs
Outdated
Show resolved
Hide resolved
…APM.cs Co-authored-by: Miha Zupan <[email protected]>
src/libraries/Common/tests/System/Net/Sockets/SocketTestServerAPM.cs
Outdated
Show resolved
Hide resolved
/ba-g test failure is #115006 |
Fixes #85666.
The test class spawns a recursive OnAccept method which uses Begin/End pattern to continue accepting connections until the server is disposed. There is a condition which allows SocketException with SocketError.InvalidArgument to be thrown out of the function which leads to test process crash.
Since any sort of exception would crash the process, this PR simplifies the logic by removing any rethrows.