Repository navigation
B7: an execution client reaches only a server it may use - #1211
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…llow Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…penhcs/ipc The test pinned the per-user ~/.openhcs/ipc directory that B7 replaced with OpenHCSZMQConfig.socket_root(). It now derives the directory from that config and checks that the viewer endpoint, viewer discovery and an execution endpoint on the same port resolve the same address. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nbindable paths and failed connects end the wait The smoke check sets TMPDIR to a deep directory under the worktree. The test run's socket root came from tempfile.mkdtemp, so every socket path was 136 bytes against a limit of 107 (zmq.IPC_PATH_MAX_LEN). Each server died at bind, the client reported only 'Failed to connect', and the measured CLI waited for a compilation that no event would ever end. - use_private_socket_root() owns the test run's root: a new directory beneath checkout_socket_root(), exported as OPENHCS_SOCKET_ROOT for every child. tests/conftest.py and the unix_socket_dir fixture use it. - ZMQExecutionClient.connect raises SocketPathTooLongError (path, length, limit) before it starts a server. - A compile that cannot connect publishes CompilationFailed per dataset, so the measured CLI and other waiters end. - Guards: a child process computes its parent's socket root, code root and audience; a private root binds whatever TMPDIR is; the client refuses an unbindable path without starting a server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a correctness bug: an execution client could connect to a server that another process tree started, and so run pipelines on another checkout's code. Receipt:
docs/refactor/consolidation-20261009/B7-server-isolation.md.Mechanism found
nto the same file,~/.openhcs/ipc/openhcs-zmq-<n>.sock.ZMQClient.connectattached to whatever answered a ping there. The reply's identity was not read.DataControlPortPairAuthority.acquirereturns a pair whose socket files are absent and reserves nothing. The parity test kept one such port for 30 workflows, each with its own short-lived server; between workflows another process could take the port, and the next workflow attached to it.disconnect().Fix (library half: OpenHCSDev/ZMQRuntime#32, zmqruntime 0.6.2)
EndpointLaunchMismatchErrornames the address and the reason.~/.openhcs/<digest>/), so two checkouts do not share addresses by default.OPENHCS_SOCKET_ROOTreplaces it for one process tree.tests/conftest.py). The harness starts private servers throughZMQExecutionClient.with_private_server; the official30 tests no longer choose an execution port.Files of in-flight surfaces touched
openhcs/agent/services/viewer_endpoint_discovery.py(U4): one expression, the socket directory now readssocket_root().openhcs/runtime/zmq_execution_client.py,zmq_execution_server.py,zmq_execution_server_launcher.py(near K7): the launch argument andcode_root.benchmark/openhcs_measured_run.py,well_throughput_scaling.py,matched_cellprofiler_batch.py(near K1/K8): client construction only.Release order
external/zmqruntimehere at that merge commit (it points at the PR branch now).pyproject.tomlalready requireszmqruntime>=0.6.2.Upgrade note: servers started before this change are not found (the socket root moved) and are not stopped by it. Stop them once by hand.
Tests run locally (this head,
-n 2, private socket root)tests/unit/test_b7_server_isolation_guards.py: 6 passed.tests/integration/test_execution_server_isolation.py(real launcher) withtest_compiled_artifact_inspection.py: 7 passed.flock .claude/verify/official30.lock: 1 passed in 661.69 s.origin/mainrun the same way (45 failed, 26 errors on both; none only on this branch). 87 more ZMQ-related unit files: 919 passed, 2 failed in the parallel run, and both of those pass alone here and on main.test_main(disk, ImageXpress, direct and zmq),test_session_journey,test_measured_cli_session,test_agent_observation_export_zmq,test_source_store_code_mode_zmq: 17 passed, 10 failed. The same 10 fail onorigin/main(ZMQRuntimeObservationExportScopehas nocheck_export_path).openhcs,scripts,benchmark) and nra-r1, run locally against the merge base: exit 0, empty delta.sun_pathunder my--basetemp; both pass with a short one).B7 · PR #1211 · guards 6/6 · production −12 +102 · tests −35 +291
🤖 Generated with Claude Code