fix: recover durable route paths after restart
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user