-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Tcp throws ArgumentNullException, when receiving data (mono, akka 1.3.1) #3092
Comments
@blackclavus I think, we can say that Akka.IO support for Mono is a "best effort" right now. It's caused mostly by fact, that the current support for things like buffers and The reason behind this bug is also part of internal bug of Mono itself and I'm afraid we cannot do much with it at this point. |
I have encountered the same problem (both in 1.3.1 and in dev under the Mono 5.2.0.215 on Ubuntu) and tracked it to the It calls [MethodImpl(MethodImplOptions.AggressiveInlining)]
private static Tcp.SocketCompleted ResolveMessage(SocketAsyncEventArgs e)
{
...
} Without this optimization, More information:
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static Tcp.SocketCompleted ResolveMessage(SocketAsyncEventArgs e)
{
Tcp.SocketCompleted res;
switch (e.LastOperation)
{
case SocketAsyncOperation.Receive:
case SocketAsyncOperation.ReceiveFrom:
case SocketAsyncOperation.ReceiveMessageFrom:
res = Tcp.SocketReceived.Instance;
break;
case SocketAsyncOperation.Send:
case SocketAsyncOperation.SendTo:
case SocketAsyncOperation.SendPackets:
res = Tcp.SocketSent.Instance;
break;
case SocketAsyncOperation.Accept:
res = Tcp.SocketAccepted.Instance;
break;
case SocketAsyncOperation.Connect:
res = Tcp.SocketConnected.Instance;
break;
default:
throw new NotSupportedException($"Socket operation {e.LastOperation} is not supported");
}
return res;
} solves the problem, but I guess the result is the same as simply removing the annotation (optimization is ignored). This is certainly a Mono problem. I am hesitant to suggest that it should be fixed in Akka, since it is clearly not Akka bug. But, would you be able to contact Mono team then, since you would have better understanding of what is really going on here? Is it also reasonable to assume that similar issues could manifest themselves in other cases using the same optimization? Meanwhile, one can disable mono
|
@mmoussikhine nice detective work! Yep, we can report the Mono bug here: https://bugzilla.xamarin.com/ I'd recommend filing a bug there and linking to this Github issue for reference. In the meantime, IMHO, I'd recommend disabling the optimization on Akka just so we can get our Mono users up and running again. Yes, there will be a performance hit - but we can put the optimization back once Mono runtime is patched with the latest. |
@mmoussikhine Would you mind sending a PR? |
Sure. Just to disable the optimization on this method? |
@mmoussikhine yep, and report the issue on Mono if you don't mind :D |
Mono bug report: |
thanks @mmoussikhine |
You sent in a PR earlier as well right, removing the optimization? |
Here: #3115 |
Closed via #3115 |
This exception thrown when a client (non-akka) send data to server (akka) via Tcp. Note that this only happen if code runs on Mono.
Sample Code:
Client Code
note: I'm using .net framework 4.6 (on both server and client)
The text was updated successfully, but these errors were encountered: