-
Notifications
You must be signed in to change notification settings - Fork 752
NetMQ.FaultException: Cannot close an uninitialised Msg. #930
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
Comments
I have just been through the same analysis and arrived at exactly the same conclusion: calling Close() on a new Msg will always result in a FaultException. The call to Close would only make sense for an existing/shared msg, rather than one having just been created. This issue has only recently become a problem for us, and seems to only affect our public API server. I suspect it may be related to connections coming and going, as nothing else sticks out as being different from our other services. Perhaps the issue is triggered by messages arriving at a PUB/XPUB socket for which no subscription exists? We are using the ManualPublisher option (true) for XPUB sockets to authenticate subscribers. Our call stack from the error is similar (but not identical) to the one reported above:
|
@valeriob you are correct, line 1137 is a mistake and should be removed. I think I would be able to reproduce this with an XPUB and Stream sockets. |
Might be, some other application might try and connect to the port. |
Sure, there you go #933 |
Hi, |
Hi,
this exception is raised every day at the same hour.
This is the stacktrace :
at NetMQ.Msg.Close() in //src/NetMQ/Msg.cs:line 458
at NetMQ.Core.Transports.StreamEngine.ProcessRoutingIdMsg(Msg& msg) in //src/NetMQ/Core/Transports/StreamEngine.cs:line 1142
at NetMQ.Core.Transports.V1Decoder.PushMsg(ProcessMsgDelegate sink) in //src/NetMQ/Core/Transports/V1Decoder.cs:line 175
at NetMQ.Core.Transports.StreamEngine.ProcessInput() in //src/NetMQ/Core/Transports/StreamEngine.cs:line 983
at NetMQ.Core.Transports.StreamEngine.FeedAction(Action action, SocketError socketError, Int32 bytesTransferred) in //src/NetMQ/Core/Transports/StreamEngine.cs:line 333
at NetMQ.Core.Utils.Proactor.Loop() in //src/NetMQ/Core/Utils/Proactor.cs:line 119
at System.Threading.ThreadHelper.ThreadStart_Context(Object state) in //src/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs:line 50
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in //src/System.Private.CoreLib/shared/System/Threading/ExecutionContext.cs:line 172
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in //src/System.Private.CoreLib/shared/System/Runtime/ExceptionServices/ExceptionDispatchInfo.cs:line 63
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in //src/System.Private.CoreLib/shared/System/Threading/ExecutionContext.cs:line 200
at System.Threading.ThreadHelper.ThreadStart() in /_/src/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs:line 100
I checked out the code at that version, and in StreamEngine.cs:line 1142 there is not a call to the Msg.Close() method.
The closest one are :
In case it's the first one, i have a bug somewhere, in case it's the second one, i have some doubts about the code.
This code should deterministically always raise the exception :
because after new Msg(), MsgType = MsgType.Uninitialised;
Given that m_subscriptionRequired is set to true in a branch of code where it says // check if it is an unversioned protocol (and i do not have any, since i only talk to my code deployed with the same version of netmq) is it possibile that some spurious data is causing the problem ?
Environment
Expected behaviour
The process not to crash.
Actual behaviour
The process crashes constantly every day at the same time.
Steps to reproduce the behaviour
I'm still digging, can you give me some advice on how to track down the problem ?
Thanks
Valerio
The text was updated successfully, but these errors were encountered: