Skip to content

fix(rpc): rescan registry after mtime changes - #15634

Merged
rgrinberg merged 1 commit into
ocaml:mainfrom
rgrinberg:push-uvnknkmknuqo
Aug 1, 2026
Merged

rgrinberg merged 1 commit into
ocaml:mainfrom
rgrinberg:push-uvnknkmknuqo

Conversation

@rgrinberg

@rgrinberg rgrinberg commented Jul 31, 2026 •

Copy link
Copy Markdown
Member

Description

Skip RPC registry scans only when the directory mtime is unchanged, and record each newly observed mtime. This allows clients that poll before Dune registers to discover the new registry entry while avoiding repeated scans afterward.

Related Issue and Motivation

Fixes #15630. The regression test was added in #15632.

Checklist

@rgrinberg
rgrinberg force-pushed the push-uvnknkmknuqo branch from eed044a to 6a5b44b Compare July 31, 2026 08:16
Skip the registry scan only when the directory mtime is unchanged and record each newly observed mtime.

Signed-off-by: Rudi Grinberg <[email protected]>
@rgrinberg
rgrinberg merged commit 863b7d0 into ocaml:main Aug 1, 2026
18 of 20 checks passed
rgrinberg added a commit to ocaml/ocaml-lsp that referenced this pull request Aug 1, 2026
Dune 3.24.1 ships an inverted RPC registry mtime skip (ocaml/dune#15630).
Clients that poll before Dune registers never see the instance and hang
waiting for a connection. ocaml/dune#15634 fixes Poll.poll; pin that patch
via applyPatches so dune-rpc (not only the dune binary) inherits it until
a release includes the fix.

Signed-off-by: Rudi Grinberg <[email protected]>
@Alizter Alizter added this to the 3.25.0 milestone Aug 2, 2026
@Alizter Alizter mentioned this pull request Aug 3, 2026
23 of 24 tasks
Alizter pushed a commit to Alizter/dune that referenced this pull request Aug 3, 2026
## Description

Skip RPC registry scans only when the directory mtime is unchanged, and
record each newly observed mtime. This allows clients that poll before
Dune registers to discover the new registry entry while avoiding
repeated scans afterward.

## Related Issue and Motivation

Fixes ocaml#15630. The regression test was added in ocaml#15632.

## Checklist

- [x] Tests added in ocaml#15632.
- [x] Change log entry added.
- [x] Documentation is not applicable to this bug fix.

Signed-off-by: Rudi Grinberg <[email protected]>
Alizter added a commit that referenced this pull request Aug 3, 2026
Backport the RPC registry regression test from #15632 and its fix from
#15634 onto `3.24.2-rc`.

The commits remain separate and in test-before-fix order.

Fixes #15630 for Dune 3.24.2.
avsm pushed a commit to ocaml/opam-repository that referenced this pull request Aug 3, 2026
CHANGES:

### Fixed

- Add the implicit `unix` dependency required by MDX 2.6 and later to
  generated MDX test executables (ocaml/dune#15592, @avsm)

- Rescan the RPC registry when its directory mtime changes, allowing clients
  that poll before Dune registers to discover the new instance (ocaml/dune#15634, fixes
  ocaml/dune#15630, @rgrinberg)
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.

RPC registry polling skips scans when the directory mtime changes

2 participants