Closed mnmr closed 1 year ago
The obvious workaround for this issue would be to add an additional while loop with a try-catch block in the Proactor.Loop
method to catch any internal errors and only surface those that are truly process-crash-worthy. This would mitigate the issue significantly even if the bug remained.
We've been using this in production for 5+ years and are only now seeing this issue, so it's absolutely caused by some specific bytes arriving at the socket.
Environment
Expected behaviour
Ability for NetMQ to handle/catch errors, and/or provide an error handling mechanism that users can plug in to. It is not nice to have code in your process that can cause it to abrubtly exit.
Actual behaviour
The process terminates.
Steps to reproduce the behaviour
I'm not sure, but someone (this is an API server where each client has their own set of DEALER/XPUB sockets to connect to) is connecting to the port and sending data that NetMQ interprets as a handshake command. The code to determine whether the Msg is a command seems to make invalid assumptions about the Data in the Msg and fails when it tries to get the command name.
Because the entire call-chain is without exception handler, the exception is only caught by the
AppDomain.CurrentDomain.UnhandledException += AppOnUnobservedException;
handler, after which the process terminates.