NetMQ / Samples

Samples of NetMQ
88 stars 43 forks source link

Question: Paranoid Pirate Pattern auto re-connect for workers and clients on queue restart #9

Open vxmark opened 5 years ago

vxmark commented 5 years ago

This question is related to the Paranoid Pirate Pattern sample project:

Is it by intention that the Paranoid Pirate Pattern is not supposed to recover from a restart of the Queue component or is this an error of the sample implementation (or even NetMQ core) which needs to be fixed?

Steps to reproduce: 1) start queue 2) start a worker 3) start a client 4) stop queue 5) wait for a timeout message of worker and/or client printed to console 6) restart queue

After these steps messages from clients wont be processed anymore despite all components (queue + worker + client) are up and running again after step 6.

vxmark commented 5 years ago

Problem located inside the worker component.

On every (heartbeat-) timeout inside the worker it will completely dispose the DealerSocket and then create a new one. But for this newly created DealerSocket the event wireup for ReceiveReady is missing. This way the new DealerSocket won't react to any incoming messages.

vxmark commented 5 years ago

For reproduction of the actual error I would recommend to disable the "crash simulation" inside the worker component. This simulation will most probably fire before one is able to see the actual error which I am addressing with this issue / pull request.