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

Fix issue with ZMQ_RECONNECT_STOP_AFTER_DISCONNECT option #4721

Merged
merged 2 commits into from
Aug 11, 2024

Conversation

githejie
Copy link
Contributor

@githejie githejie commented Aug 9, 2024

Solution: Specify _disconnected as false in initialize list to solve this problem, and add tests to cover this scenario.

Fixed #4720

@bluca
Copy link
Member

bluca commented Aug 9, 2024

68: C:\projects\libzmq\tests\test_reconnect_options.cpp:269:reconnect_stop_after_disconnect:FAIL: zmq_connect (sub, "ipc://@dummy") failed, errno = 135 (Protocol not supported)

@githejie githejie force-pushed the reconnect_options branch from 7e677bb to d8d7fc4 Compare August 9, 2024 13:27
@githejie
Copy link
Contributor Author

githejie commented Aug 9, 2024

68: C:\projects\libzmq\tests\test_reconnect_options.cpp:269:reconnect_stop_after_disconnect:FAIL: zmq_connect (sub, "ipc://@dummy") failed, errno = 135 (Protocol not supported)

I have replaced ipc://@dummy with ipc://., thanks @bluca for pointing this out.

@githejie githejie force-pushed the reconnect_options branch from d8d7fc4 to be06569 Compare August 9, 2024 15:54
Solution: this test failed because "_disconnected" is not initialized
in constructor, and the behavior of reconnect will not be as designed
when "_disconnected" is randomly assigned to true.
So we specify it as false in initialize list to solve this problem.
@githejie githejie force-pushed the reconnect_options branch from be06569 to ce17349 Compare August 9, 2024 16:10
@githejie
Copy link
Contributor Author

githejie commented Aug 9, 2024

Hi, @bluca I mistakenly thought that the error you showed was because Windows does not support the @ syntax. After reading the relevant code, I realized that ZMQ does not support IPC in all cases (no wonder CI and my local Windows platform cannot reproduce this problem). I added the ZMQ_HAVE_IPC macro to this new test to ensure that this test will not be run if IPC is not supported.

@bluca bluca merged commit 6aaafe0 into zeromq:master Aug 11, 2024
21 of 22 checks passed
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

Successfully merging this pull request may close these issues.

Issue with ZMQ_RECONNECT_STOP_AFTER_DISCONNECT option
2 participants