Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[ZMQ] append a message sequence number to every ZMQ notification #7762
Currently, ZMQ listeners cannot detect if they have missed a message.
The sequence number is the last part of the multipart zmq message to not break the API, though, we could consider breaking the API in favor of moving the sequence number to the very beginning.
The way we are using ZMQ, the sender will never block. This is sensible as we don't want to hang the application due to a slow client. But this means at some point one of the send queues will fill up and new messages will be discarded.
That's up to the application. Either stop with a fatal error, or re-start/re-sync. An event application usually does some synchronization at start-up, then starts processing incremental changes. After getting out of sync it can repeat the process. The important thing is being able to detect it and thus act on it.
Apr 19, 2016
1 check was pending
added a commit
this pull request
Apr 19, 2016
Could we make that parameterizable?
Well notifications can be lost, through zmq or otherwise, for example if bitcoind needs to be restarted, or a myriad of other circumstances not under your control. At least you can detect it now:
Your application needs an (application dependent) way to resync anyhow. This is better than pretending to guarantee something.