[zeromq-dev] Ping Pong Heartbeats & Quick Server Restart Issue

Stephen Lord Steve.Lord at quantum.com
Mon Mar 23 16:50:52 CET 2015


Have the heartbeat reply include a guid which represents the instance of the server, the server picks a guid at startup and always uses it. If the client sees two different guids then it knows the server restarted and can take action. The server side state is minimal, the client needs to track the guids it gets back on a per server basis.


On Mar 23, 2015, at 9:39 AM, Russell Della Rosa <rdellar2000-zeromq at yahoo.com<mailto:rdellar2000-zeromq at yahoo.com>> wrote:

I'm doing this using JeroMq (may use jzmq at some point) so I'm at the mercy of the JVM.

I have a wrapper around the JVM that heartbeats also, it and will kill the JVM if it doesn't reply with a pong.  After the wrapper kills the JVM, it will quickly restart the JVM so I'm not sure there is a good point to send this shutdown message.  (The wrapper might be able to but I think that might get complex.)

I like this idea though since it keeps the server stateless.

________________________________
From: Justin Karneges <justin at affinix.com<mailto:justin at affinix.com>>
To: zeromq-dev at lists.zeromq.org<mailto:zeromq-dev at lists.zeromq.org>
Sent: Friday, March 20, 2015 2:41 PM
Subject: Re: [zeromq-dev] Ping Pong Heartbeats & Quick Server Restart Issue

> I'm curious if anyone has solved this quick server restart problem in a
> clean way with socket patterns?  Or if you have other suggestions?  Or if
> you have example code of ping/pong handling this case I'd love to see it.

I suggest having the server send some kind of shutdown message. This is
basically the same as how regular TCP connection loss is indicated,
except that you have to do it yourself rather than the OS doing it for



you.


Of course, the advantage of the OS doing it for you is that you can
ensure a close packet is sent even if your process crashes. This may bit
a bit harder to do with ZeroMQ, depending on the language.
_______________________________________________
zeromq-dev mailing list
zeromq-dev at lists.zeromq.org<mailto:zeromq-dev at lists.zeromq.org>
http://lists.zeromq.org/mailman/listinfo/zeromq-dev<https://urldefense.proofpoint.com/v1/url?u=http://lists.zeromq.org/mailman/listinfo/zeromq-dev&k=8F5TVnBDKF32UabxXsxZiA%3D%3D%0A&r=3Cz4BWxkuioYQ%2BdxY62EqptPwDeTj3M%2B5v06yEnFWTY%3D%0A&m=7MAl5btFQ60vHCXT9uKH65obPguN3ihVUEVTNwTJvzY%3D%0A&s=caf963151a45847acc3cf01940a6b42b97590128726ebbf7e0ef3af7f0b78330>



_______________________________________________
zeromq-dev mailing list
zeromq-dev at lists.zeromq.org<mailto:zeromq-dev at lists.zeromq.org>
https://urldefense.proofpoint.com/v1/url?u=http://lists.zeromq.org/mailman/listinfo/zeromq-dev&k=8F5TVnBDKF32UabxXsxZiA%3D%3D%0A&r=3Cz4BWxkuioYQ%2BdxY62EqptPwDeTj3M%2B5v06yEnFWTY%3D%0A&m=7MAl5btFQ60vHCXT9uKH65obPguN3ihVUEVTNwTJvzY%3D%0A&s=caf963151a45847acc3cf01940a6b42b97590128726ebbf7e0ef3af7f0b78330


----------------------------------------------------------------------
The information contained in this transmission may be confidential. Any disclosure, copying, or further distribution of confidential information is not permitted unless such privilege is explicitly granted in writing by Quantum. Quantum reserves the right to have electronic communications, including email and attachments, sent across its networks filtered through anti virus and spam software programs and retain such messages in order to comply with applicable data security and retention requirements. Quantum is not responsible for the proper and complete transmission of the substance of this communication or for any delay in its receipt.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20150323/8cd93867/attachment.htm>


More information about the zeromq-dev mailing list