zeromq / netmq

A 100% native C# implementation of ZeroMQ for .NET
Other
2.94k stars 742 forks source link

Application using current Stable release just crashes #444

Closed gtemgoua closed 4 years ago

gtemgoua commented 8 years ago

I am using the NetMQ version 3.3.0.11 in my application and just started receiving the following: Log Name: Application Source: .NET Runtime Date: 1/21/2016 12:48:17 PM Event ID: 1026 Task Category: None Level: Error Keywords: Classic User: N/A Computer: xxxxx Description: Application: MyServer.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: NetMQ.NetMQException Stack: at NetMQ.zmq.TcpConnecter.Connect() at NetMQ.zmq.TcpConnecter.OutEvent() at NetMQ.zmq.TcpConnecter.InEvent() at NetMQ.zmq.IOObject.InEvent() at NetMQ.zmq.Poller.Loop() at System.Threading.ThreadHelper.ThreadStart_Context(System.Object) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at System.Threading.ThreadHelper.ThreadStart()

can someone shed any lights on what might be the cause of this ?

somdoron commented 8 years ago

do you know what was the SocketError? I think this bug was fixed in recent version. Did the network went down for a moment?

gtemgoua commented 8 years ago

I couldn't find that out quickly but one thing i did was to create a static context object and use that to start all my other requestSockets. so far no issues yet. which version do you advise as a stable option to migrate to ? - Louis

On Monday, January 25, 2016 3:33 AM, Doron Somech <notifications@github.com> wrote:

do you know what was the SocketError? I think this bug was fixed in recent version. Did the network went down for a moment?— Reply to this email directly or view it on GitHub.

somdoron commented 8 years ago

the nuget stable is currently the best one to use.

Do you have code that reproduce the issue you had?

gtemgoua commented 8 years ago

@somotech, I upgraded my NetMQ to 3.3.2.2, I have also cautiously made my context static object as opposed to local variable within some of my threads and i feel that this version of my code is breathing easy. My code is so convoluted that it is very hard for me to submit some code samples. But the general idea is that i have a client application and a server app that process requests and send back responses. The server is implementing a weird pattern of Router-Router and launching background processes that binds to the Backend Router of the Server and sends back responsesThe client is also a heavily  multithreaded application that has client requests sockets used to form requests for the server and are expecting responses from the server workers. my problem for some reason is not on the server side but is on the client side because when i shut that down i can end up with that error i sent since I am not sure which thread is waiting to receive data or has already sent a request.Come to think of it, in order to close my client thread in the middle of processing, should i just call the close method on a socket ? will that throw an exception if it was waiting on a ReceiveFrameString ? - Louis

On Monday, January 25, 2016 12:48 PM, Doron Somech <notifications@github.com> wrote:

the nuget stable is currently the best one to use.Do you have code that reproduce the issue you had?— Reply to this email directly or view it on GitHub.

somdoron commented 8 years ago

closing socket from another thread is not a good approach.

I think the best solution is to use NetMQActor, look at the docs. Also you can use NetMQProactor, but it is only on beta versions.

gtemgoua commented 8 years ago

Thanks @somotech, I will look into that and see how it changes my original design or just fits in. we can close this issue tho - Louis

On Wednesday, January 27, 2016 4:55 AM, Doron Somech <notifications@github.com> wrote:

closing socket from another thread is not a good approach.I think the best solution is to use NetMQActor, look at the docs. Also you can use NetMQProactor, but it is only on beta versions.— Reply to this email directly or view it on GitHub.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had activity for 365 days. It will be closed if no further activity occurs within 56 days. Thank you for your contributions.