Skip to content

Bind only missing ZeroMQ endpoints - #2829

Open
MichaelHuth wants to merge 2 commits into
mainfrom
feature/2829-zeromq-bound-endpoints
Open

MichaelHuth wants to merge 2 commits into
mainfrom
feature/2829-zeromq-bound-endpoints

Conversation

@MichaelHuth

@MichaelHuth MichaelHuth commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Uses the Zeromq XOP from AllenInstitute/ZeroMQ-XOP#85 in the first commit.

  • update XOP commit once more for the right commit hash as I had to update some other files in PR 85 (pipeline 156731)

StartZeroMQSockets could not tell whether a failed bind meant that this Igor Pro instance or another process holds the MIES endpoint, so it treated every failed bind as "already bound". With a second Igor Pro instance holding the port, MIES reported success without listening on it.

Changes

  • Update the ZeroMQ XOP to the CI builds of zeromq_server_recv() and zeromq_server_send() can hang Igor Pro while the message handler runs ZeroMQ-XOP#88, together with its help file and the hash in CHI_CheckInstallation.
  • StartZeroMQSockets asks the XOP for its bound endpoints with the new zeromq_get_bound_endpoints() and only binds the missing MIES endpoints. A failed bind is now reported as an error, naming the endpoint. The endpoints of other packages using the XOP, e.g. the Igor Pro Bridge, stay untouched.
  • Tests for binding only the missing endpoints and for reporting an endpoint that is already in use.

The Zeromq XOP added by this PR also fixes #2823

close #2823

@MichaelHuth MichaelHuth self-assigned this Oct 30, 2026
Copilot AI balanced review requested due to automatic review settings October 30, 2026 14:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@t-b t-b mentioned this pull request Oct 30, 2026
2 tasks
@t-b
t-b requested a balanced review from Copilot November 1, 2026 20:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The test verifies the error return but not that the bind-failure diagnostic identifies the blocked server endpoint, so a missing or incorrect message would go undetected.

1 open issue

Review effort: Balanced

@MichaelHuth
MichaelHuth force-pushed the feature/2829-zeromq-bound-endpoints branch 2 times, most recently from 2ae99a9 to 587e566 Compare November 9, 2026 10:41
StartZeroMQSockets can't tell whether a failed bind means that this
Igor Pro instance or another process holds the endpoint. The ZeroMQ XOP
now returns the endpoints it has bound with zeromq_get_bound_endpoints(),
added in its PR 84. PR 89 fixes a hang of this function: it waited for
the mutex of the server socket, which the thread of a running message
handler takes again every 1 ms, so Igor Pro could hang for good.

The XOP also fixes lost CallFunction replies when several clients are
connected, e.g. two Igor Pro instances, and adds a receive timeout for
zeromq_client_recv() in PR 83, and fixes the clang-tidy findings in
PR 85. With PR 75, errors of the zmq library are no longer printed to
the history but only returned as runtime errors.

The Windows and macOS XOPs are the Release builds from the CI package
job of ZeroMQ-XOP main at d9173ee4 (Merge pull request #89 from
AllenInstitute/mh_fix_endpoint_list_starvation, 2026-11-10), which
includes PRs 83, 84, 85, 75 and 89. The help file is unchanged since
PR 85, and CHI_CheckInstallation checks the hash of the new Windows XOP.
@MichaelHuth
MichaelHuth force-pushed the feature/2829-zeromq-bound-endpoints branch from 587e566 to a27e23d Compare November 10, 2026 18:16
Since 9aaf9f2 (Wrap zeromq_stop() in its own function, adding a restart
if the Igor Pro Bridge, 2026-08-19) StartZeroMQSockets binds the MIES
endpoints also when another package, e.g. the Igor Pro Bridge, already
started the message handler. A failed bind was treated as the endpoint
being bound by MIES in this Igor Pro instance, as the ZeroMQ XOP could
not tell otherwise. When a second Igor Pro instance holds the endpoint,
MIES therefore reported success without listening on it.

The ZeroMQ XOP now returns the endpoints it has bound with
zeromq_get_bound_endpoints(). StartZeroMQSockets only binds the MIES
endpoints missing from that list, so a failed bind is a real error. It
names the endpoint and returns the error, but keeps the endpoints of the
other packages if they started the message handler.

The socket types for zeromq_get_bound_endpoints() are added to the copy
of ZeroMQ_Interop.ipf.
@MichaelHuth
MichaelHuth force-pushed the feature/2829-zeromq-bound-endpoints branch from a27e23d to 9564d3f Compare November 10, 2026 18:20
@MichaelHuth MichaelHuth assigned t-b and unassigned MichaelHuth Nov 10, 2026
@t-b
t-b enabled auto-merge November 10, 2026 19:38
@t-b

t-b commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Review:

7e251b8 (XOPs: Update the ZeroMQ XOP, 2026-10-30)

  • The commit message is awful to read. Why does it repeat what's in the ZeroMQ XOP repo documented? Just
    mention the commit the binaries are built from and that's it.
  • This commit should also contain the updated procedure file

9564d3f (StartZeroMQSockets: Bind only the endpoints missing in this instance, 2026-10-30)

Looks good.

+	Sort endpoints, endpoints
+	Sort expected, expected
+	CHECK_EQUAL_TEXTWAVES(endpoints, expected)

I've filed byte-physics/igortest#513 to make that nicer in the future.

@t-b t-b left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment

@t-b t-b assigned MichaelHuth and unassigned t-b Nov 11, 2026

This branch has not been deployed

No deployments
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.

ZeroMQ XOP: Cross IP instance communication does not work anymore

3 participants