Skip to content

Watchdog: fail early on unreachable sources, always write the manifest - #293

Merged
bruno-f-cruz merged 5 commits into
mainfrom
feat/watchdog-unreachable-sources
Oct 31, 2026
Merged

bruno-f-cruz merged 5 commits into
mainfrom
feat/watchdog-unreachable-sources

Conversation

@bruno-f-cruz

@bruno-f-cruz bruno-f-cruz commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Watchdog sources can now be network shares on other rigs (e.g. \rig-b\data\<session>, passed alongside the local session folder). _create_manifest_from_session now checks every source upfront and raises one FileNotFoundError listing all missing or unreachable ones, instead of failing partway through the modality search.

The folder-based modality search itself is unchanged and already works on UNC paths. The check itself is independent of the XML-RPC PRs.

Note: this checks reachability from the launcher's account. The watchdog process reads the sources at schedule_time under its own account, which needs access to the share too.

Example

examples/client_behavior_launcher.py now shows a transfer covering both machines:

remote = RemoteRepository(client, data_roots={r"D:\data": r"\rig-b\data"})
remote.register_session(session, r"D:\data")
...
WatchdogDataTransferService(
    source=[launcher.session_directory, remote.session_directory_unc],
    settings=WatchdogSettings(destination=..., project_name=...),
    session=session,
).transfer()

(Updated with main now that #291 and #292 are merged; the example uses RemoteRepository from #292.)

Always write the manifest (closes #290)

transfer() used to start the watchdog service first and raise before writing the manifest when that failed, so the session wasn't queued at all. The manifest is now written first, then the service is started if needed.

This works because the service processes existing manifests on startup: EventHandler._startup_manifest_check() in aind-watchdog-service 0.1.6 schedules every *manifest*.* file in flag_dir, and clabe writes manifest_<session>.yaml. Starting the service never raises: if it can't be started (for any error, or if it still isn't running afterwards), transfer() logs an error naming the manifest, which will be transferred once the service runs.

A source that can't be reached, or a manifest that fails to build, still raises without writing anything, as before.

Sources can now be network shares on other rigs, so list every missing or
unreachable source up front instead of failing partway through the
modality search.
The remote machine registers the session under its own data root, and
the watchdog gets the launcher's session directory and the remote one
through its network share (remote.session_directory_unc).
transfer() used to start the watchdog service first and raise before
writing the manifest when that failed, so the session was not queued at
all. The manifest is now written first: the service processes existing
manifests in its flag_dir when it starts, so the transfer still happens.
If the service cannot be started, transfer() still raises, and the error
names the written manifest.

Closes #290
@bruno-f-cruz bruno-f-cruz changed the title Fail early when a watchdog source directory is unreachable Watchdog: fail early on unreachable sources, always write the manifest Oct 31, 2026
The manifest is already written and is processed when the service
starts, so a failed start is now logged as an error naming the queued
manifest instead of raised. Any error while checking or starting the
service is caught, not only CalledProcessError.
@bruno-f-cruz
bruno-f-cruz merged commit 039876b into main Oct 31, 2026
9 checks passed
@bruno-f-cruz
bruno-f-cruz deleted the feat/watchdog-unreachable-sources branch October 31, 2026 06:27
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.

Consider always dumping watchdog manifest even if executable is not running

1 participant