Skip to content

Two port-reservation registries now run the same protocol in different directories — converge sdui_pick_free_port and smoke_pick_free_port onto one helper #10261

Description

@os-zhuang

Filed unassigned by the dev seat working #10212. Not a defect today — recorded so the
duplication is a deliberate state rather than an accident. Duplicate search first
(quoted "port-reservations", "PORT_RESERVATION_DIR", "pick_free_port", plus a
semantic search for registry convergence): no hits other than #10167/#10212 themselves.

What is on main now

Two shell helpers run a byte-identical claim-before-probe protocol against two
different directories
:

sdui_pick_free_portsmoke_pick_free_port
scriptscripts/gen-sdui-manifest.shscripts/publish-smoke.sh
registry${TMPDIR:-/tmp}/sdui-port-reservations${TMPDIR:-/tmp}/objectstack-port-reservations
overrideSDUI_PORT_RESERVATION_DIRSMOKE_PORT_RESERVATION_DIR
base port51803210
probeprobe.listen(port, '127.0.0.1')probe.listen(port) (wildcard)

Landed by #10217 (#10167) and the #10212 PR respectively. Normalising the names and
diffing the two node programs shows the on-disk format and every algorithm — O_EXCL
claim, release-on-probe-failure, sweep floor/ceiling, pid liveness, flock around the
sweep only — is identical; the only differences are the registry directory and the
probe address.

Why it was left this way rather than merged in the #10212 PR

What converging would look like

One helper — probably sourced from a small scripts/lib/ file both scripts read — taking
base, span and the probe address, against a single neutral registry. The
objectstack-port-reservations directory name was chosen in #10212 expressly so that
convergence is a pure rename on the sdui side, with no on-disk format change and no
migration: existing claim files stay valid.

⚠️ Whoever takes this should keep the two collision tests' contention assertions
(CONCURRENT_DISTINCT, TRIPLE_DISTINCT, and the STEAL_CLAIM_ON_PICK positive
control) running against the real shared registry rather than an overridden scratch
one — the point of those is that they measure the registry actual callers use.


Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions