[nanomsg] Re: publisher side filtering

  • From: Martin Sustrik <sustrik@xxxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Wed, 07 May 2014 07:16:51 +0200

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/05/14 01:50, Alex Elsayed wrote:

> Again assuming separate state machines per SUB/PUB pair, the state
> machines can progress independently and asynchronously. We can
> simply check on each recv() of the aggregate SUB whether
> any-of(ack, message) has occurred (which should be non-blocking and
> fast). If that doesn't occur prior to some timeout, disconnect and
> retry on that state machine alone.

Here's exactly where the problem happens:

You put all the current subscriptions into a single batch and send
them to th PUB. However, PUB haven't acked it yet. In the meantime
user is issuing new subscriptions. These have to be sent to the PUB as
well. So we are going to queue them in the meantime. The queue grows
until it reaches the memory limit.

Now what?

We can try to re-connect, but then we are just doing the same thing
again, while at the same time overloading the network by duplicate
subscription batches.

Moreover if the PUB has many subscribers and happens to be slow at the
moment, the subscribers would interpret that as a timeout and try to
resend the subscriptions. Thus, PUB would be bombarded with repeated
subscription batches from all the SUBs which will probably kill it.

Martin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTacG+AAoJENTpVjxCNN9YWPQIAIDjzQ0GIKE98BtRuUDMPx/I
Zs5vZbbijwyfeJEHaA2uVSlNSLJIvuWw1bA3OtQqJwcyV+0wWTFGf4e+MzOOsDVa
ufqXHLXfVPbBT8T8f070dDJGXWB6SBcia13QtZlnnLzvMyt/foMJ/71R5ETgkqWw
SJk8QE8rzUTdehWmwMu5HJ4ElVA5NLb1jJEFbEVdy/7CdzHelgFsBs8pxwt/JmkF
CxP5d/gUz9s2O8dVWNSCL1jVwfBpuKzewNEH4So4/b02QKSP0Os9EDZkXfzLdrau
4eJqfaAgmAue5o8AOv6zjsjj6rsvPFER4DG5gxa43py4ZXxAY1ZWNRkGS9kZRA8=
=9twI
-----END PGP SIGNATURE-----

Other related posts: