fix: recover durable route paths after restart

This commit is contained in:
2026-08-03 11:19:45 +00:00
parent a7bc2bf087
commit eabbda3c3a
5 changed files with 105 additions and 6 deletions
+16 -1
View File
@@ -697,7 +697,22 @@ class ArchiveClientDaemon:
decode_message(str(row["update_json"]), control_pb2.RouteUpdate())
)
await outbound.put(encode(response))
if attempt["state"] in {"ready", "failed"}:
if attempt["state"] == "ready":
# Route readiness is durable, but this process-local lookup is
# not. Reconfigure (which validates the existing Syncthing folder
# and recreates its local directory if necessary) before replaying
# the stored READY updates. This is essential after a daemon or
# mount restart: a previously ready route may otherwise point at a
# path that is no longer present, and a later source-stage command
# would fail with a bare ENOENT.
configured = await asyncio.to_thread(
self.routes.configure,
spec,
time.monotonic() + spec.setup_timeout_seconds,
)
self._known_route_paths[spec.route_id] = configured.local_path
return
if attempt["state"] == "failed":
return
deadline = time.monotonic() + spec.setup_timeout_seconds