Skip to content
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

SEHException in ZeroMQ.Interop.Retry.IfInterrupted? #163

Open
codeoverhaul opened this issue Aug 6, 2014 · 2 comments
Open

SEHException in ZeroMQ.Interop.Retry.IfInterrupted? #163

codeoverhaul opened this issue Aug 6, 2014 · 2 comments

Comments

@codeoverhaul
Copy link

Has anyone experienced the exception below? My .NET 4.5 application is using the PUB/SUB pattern, and the exception below is thrown from time to time in the receive loop of my subscriber class. I'm unable to reproduce it at will, so I'm at a loss. I've also included the receive method from by subscriber class below.

----- Exception ----
System.Runtime.InteropServices.SEHException was unhandled
HResult=-2147467259
Message=External component has thrown an exception.
Source=clrzmq
ErrorCode=-2147467259
StackTrace:
at ZeroMQ.Interop.Retry.IfInterrupted[T1,T2,T3](Func4 operation, T1 arg1, T2 arg2, T3 arg3) at ZeroMQ.Interop.SocketProxy.Receive(Byte[] buffer, Int32 flags, Int32& size) at ZeroMQ.ZmqSocket.Receive(Byte[] buffer, SocketFlags flags, Int32& size) at ZeroMQ.ExecuteExtensions.WithTimeout[T1,T2,T3,TResult](ZmqSocket socket, ThirdParamOut4 method, T1 arg1, T2 arg2, T3& arg3, TimeSpan timeout)
at ZeroMQ.ZmqSocket.Receive(Byte[] buffer, TimeSpan timeout, Int32& size)
at ZeroMQ.SendReceiveExtensions.Receive(ZmqSocket socket, Encoding encoding, TimeSpan timeout)
at EPanicButtonReceiver.Classes.ZeroMqSubscriber.ReceiveData()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

------------------- Receive Method -----------------------

private void ReceiveData()
{
try
{
while (!this.stopEvent.WaitOne(0))
{
var channel = subscriberSocket.Receive(Encoding.UTF8,
new TimeSpan(0, 0, 0, 1));

                if (string.IsNullOrEmpty(channel))
                {
                    continue;
                }

                lock (this.locker)
                {
                    this.RaiseAlertMessage();
                }
            }
        }
        catch (ZeroMQ.ZmqException ex)
        {
            ELogger.Log(ex.Message);
        }
        finally
        {
            if (subscriberSocket != null)
            {
                subscriberSocket.UnsubscribeAll();
            }

        }
    }
@tnthao
Copy link

tnthao commented May 31, 2018

did you ever resolve this issue? i'm seeing the same thing. very hard to reproduce, happens once in a blue moon.

@mycroes
Copy link

mycroes commented Sep 15, 2020

Same for me, our application crashed twice in 4 days, while it has been working without issues (albeit not without occasional restarts on server updates) for something like 4 years. I do have the impression that it's related to network load on the server (max number of open connections perhaps?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants