Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multibulk lost on publisher subscriber schema #47

Open
GoogleCodeExporter opened this issue Apr 23, 2016 · 0 comments
Open

Multibulk lost on publisher subscriber schema #47

GoogleCodeExporter opened this issue Apr 23, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

When in a publisher/subscriber schema some published messages may be lost with 
curren implementation of cr_readln

I attach two test files, one is a publisher, and the oter is a subscriber. Just 
compile and launch the subscriber before publisher.

*Some frames get lost because of line 

  rc = cr_receivedata(rhnd->fd, rhnd->timeout, buf->data + buf->len, avail);

When filling the buffer, it can be populated with more than a message. Only 
first message gets parsed and other messages are lost.

If that line is modified to
  rc = cr_receivedata(rhnd->fd, rhnd->timeout, buf->data + buf->len, 1);

Recompile and run the same test, shows no message lost.

Some speed will be lost with this patch (i haven't bencharmked this, and 
probably won't do) but no message will be lost.

I think that is a trade off between speed and fiability.

Tests and patch are provided.

Any other implementation with no speed lost will be welcome.

Original issue reported on code.google.com by octaviob...@gmail.com on 24 Apr 2012 at 1:44

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant