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

mlm_client_send returns OK when no message was sent #212

Open
malanka opened this issue Aug 23, 2016 · 3 comments
Open

mlm_client_send returns OK when no message was sent #212

malanka opened this issue Aug 23, 2016 · 3 comments

Comments

@malanka
Copy link
Contributor

malanka commented Aug 23, 2016

Hi,

simple example:

# include <malamute.h>

int main () {
    mlm_client_t *client = mlm_client_new();
    mlm_client_connect (client, "ipc://@/malamute", 1000, "myname");

    zmsg_t* msg = zmsg_new ();
    int rv = mlm_client_send (client, "subject", &msg);
    printf ("rv=%d\n", rv);
    mlm_client_destroy (&client);
    return 0;
}

I would expect mlm_client_send return -1 (as message was NOT actually send), but unfortunately it returned 0.

mlm_client_set_producer was intentionally omitted.

@jimklimov
Copy link
Member

+1 : according to recent bugs our team dealt with, this misbehavior was still in place, and bit us with some collateral damage.

@bluca
Copy link
Member

bluca commented Sep 4, 2017

man zmq_msg_send

 Note
 A successful invocation of zmq_msg_send() does not indicate that the message has been
 transmitted to the network, only that it has been queued on the socket and 0MQ has assumed
 responsibility for the message.

All messages are sent asynchronously, so the synchronous API call cannot know if the message has been sent over the network or not. Only if there were problems when creating it and queueing it up (or HWMs were full, etc)

@jimklimov
Copy link
Member

According to our devs (and sorry if I'm playing broken phone here):

(our original issue in our project) is technically resolved by malamute upstream/master - send on unset stream behaves properly, but puts agent into state where calls to set consumer/producer fail. I'm not sure I consider that a bug.
(The case was: ) We get a request to publish something before we set the stream, we try to publish, we try to set the stream and the last call fails. The concrete issue was resolved by fixing our race condition, now I am just trying to see if there is something Malamute can do to prevent it from happening again.

So that's about all the summary I have to forward at this time :)

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

No branches or pull requests

3 participants