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

php-ext unexpected behaviour of ZMQ_LINGER=0 #3234

Closed
proArtex opened this issue Aug 24, 2018 · 8 comments
Closed

php-ext unexpected behaviour of ZMQ_LINGER=0 #3234

proArtex opened this issue Aug 24, 2018 · 8 comments

Comments

@proArtex
Copy link

proArtex commented Aug 24, 2018

Issue description

Could you please verify that php-ext behaviour is incorrect according to this issue

Environment

  • libzmq version 4.2.5
  • ext-zmq version 1.1.3
  • Mac OS Sierra 10.12.6

Minimal test code / Steps to reproduce the issue

  1. create persistent context

  2. create socket (PULL)

  3. bind to tcp://127.0.0.1:5555

  4. recv in cycle

  5. create another persistent context

  6. create another socket (PUSH)

  7. set socket opt ZMQ_LINGER = 0

  8. connect to tcp://127.0.0.1:5555

  9. send message

What's the actual result? (include assertion message & call stack if applicable)

There is like 1 of 5 sent messages (step 5-9) received.

What's the expected result?

5 messages received.

@bluca
Copy link
Member

bluca commented Aug 24, 2018

I'm not sure I follow - what exactly is the issue? If you close a program with linger 0 then messages may be dropped

@proArtex
Copy link
Author

proArtex commented Aug 24, 2018

PUSH socket with linger 0 stop to send messages to alive PULL one, it may send like 1 of 5 tries. PUSH socket has short fpm-script life, when PULL socket is still alive as cli.

My goal is to do not receive messages by crushed and reran PULL socket from PUSH message queue.

@bluca
Copy link
Member

bluca commented Aug 24, 2018

I still don't follow. You've set linger 0, and then the script exits after sending. Is that right?

@proArtex
Copy link
Author

That's right. You can see php example here

@bluca
Copy link
Member

bluca commented Aug 24, 2018

That's working as intended. If you don't want messages to be lost, set linger to infinite.

@bluca bluca closed this as completed Aug 24, 2018
@proArtex
Copy link
Author

proArtex commented Aug 24, 2018

You didn't catch the point. I want them to be lost. But if I set linger 0 there no delivered messages at all during alive sockets.

@bluca
Copy link
Member

bluca commented Aug 24, 2018

Yes. That's because the script exits and the sockets are killed before the messages are delivered. That's what linger is for.

@proArtex
Copy link
Author

Got it. Thanks!

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

2 participants