You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some unit tests are failing on macOS because of an exception while e.AcceptSocket.NoDelay = true; is called in GarnetServerTcp.HandleNewConnection. It looks like that on macOS, the prior check if (e.SocketError != SocketError.Success) is false when it should be true.
Replacing the code here to:
try{
e.AcceptSocket.NoDelay =true;}catch(SocketExceptionexception){
logger?.LogError(exception,"Error setting NoDelay on accepted socket");returnfalse;}
Allows me to have all the unit tests that were failing because of this to pass.
Callstack:
Exit code is 134 (Unhandled exception. System.Net.Sockets.SocketException (22): Invalid argument
at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, Boolean disconnectOnFailure, String callerName)
at System.Net.Sockets.Socket.UpdateStatusAfterSocketOptionErrorAndThrowException(SocketError error, String callerName)
at Garnet.server.GarnetServerTcp.HandleNewConnection(SocketAsyncEventArgs e) in /Users/plucked/Development/garnet/libs/server/Servers/GarnetServerTcp.cs:line 121
at Garnet.server.GarnetServerTcp.AcceptEventArg_Completed(Object sender, SocketAsyncEventArgs e) in /Users/plucked/Development/garnet/libs/server/Servers/GarnetServerTcp.cs:line 105
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.Sockets.SocketAsyncEventArgs.AcceptCompletionCallback(IntPtr acceptedFileDescriptor, Memory`1 socketAddress, SocketError socketError)
at System.Net.Sockets.SocketAsyncEngine.System.Threading.IThreadPoolWorkItem.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
at System.Threading.Thread.StartCallback())
Steps to reproduce the bug
Clone and run the unit tests
Expected behavior
The unit tests should pass
Screenshots
No response
Release version
main
IDE
Rider 2024.1.5
OS version
macOS 14.5
Additional context
No response
The text was updated successfully, but these errors were encountered:
Interesting, perhaps e.AcceptSocket.NoDelay = true; can be moved into the try that follows below that section, so that we do not pay for two try/catch sections.
Interesting, perhaps e.AcceptSocket.NoDelay = true; can be moved into the try that follows below that section, so that we do not pay for two try/catch sections.
If you or anyone can try this and verify that it fixes the problem, feel free to create a PR.
Describe the bug
Some unit tests are failing on macOS because of an exception while
e.AcceptSocket.NoDelay = true;
is called inGarnetServerTcp.HandleNewConnection
. It looks like that on macOS, the prior checkif (e.SocketError != SocketError.Success)
is false when it should be true.Replacing the code here to:
Allows me to have all the unit tests that were failing because of this to pass.
Callstack:
Steps to reproduce the bug
Expected behavior
The unit tests should pass
Screenshots
No response
Release version
main
IDE
Rider 2024.1.5
OS version
macOS 14.5
Additional context
No response
The text was updated successfully, but these errors were encountered: