fix(mcp): after a close is answered nothing of this process can write to the book, and a close says when its last backup wasn't whole
A close ended with the process still alive, so the faults that process exit used to bound now lived on: something of the server's own could still write to a book that was reported closed, or, once the book was opened again (here or by another process), to the new book's files. One rule now: after a close is answered this process holds nothing that writes to the book's folder, and every path that touches the book is either counted by its gate or checks, under the lock of its own write, that the book is still open. The close answers only when that is true. * A refusal's access record is written by a task that carries the request's place inside the door, so a client hanging up no longer leaves the record to land after the close; the access log, uploads, exports and backups are closed under their own locks by the close, so a record, sweep or run still on its way is refused, unwritten. * A restore over an open book lets go as a close does (drain, sessions, backups, closing the logs) before it moves the book to legacy/: an upload half received no longer leaves its part in legacy/ nor writes to the replaced book's log after. * The backup at a close is bounded, and a run past its bound is stopped (git killed with all it started) and waited for to end, instead of its future being dropped while its blocking task went on; the close answers closed_backup_incomplete, with why, when the last backup wasn't whole. The server's own close does the same. * Every timer (the sweep, the look for a backup due, the look for a drill due) works on handles closed with the book; the sweep also takes its place inside the door. They take --timers for tests. * A format upgrade, run, drill and record through a backup handle from before a close do nothing. * A call whose answer isn't read within the grace is the case of a connection dropped at any other moment: its record, written before its answer, says it ran. No journaled call carries a client key or a duplicate check, so a retry isn't made safe; said in INVARIANT 14, and left as an open design point. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
181859d801
commit
26b42c6d01
9 files changed
+1723
-148
No files matched your search
@@ -35,7 +35,11 @@
|
||||
//! admin requests (plan/p15-app-and-relay.md 3.1; D-77, D-78): each
|
||||
//! answers what happened in a word (opened, already open, closed,
|
||||
//! was not open, no such book, could not open with why), and a book
|
||||
//! that is closed is listed as closed, which is not a problem.
|
||||
//! that is closed is listed as closed, which is not a problem. A
|
||||
//! close is answered only when the books are let go and nothing of
|
||||
//! this process's can write to them; its last backup (a bounded
|
||||
//! step) that wasn't whole is said, in `closed_backup_incomplete`
|
||||
//! with why, never as a plain `closed`.
|
||||
//! 9. `sessions` says, for each open book, who is connected: a token's
|
||||
//! NAME (never its text, nor its hash), what the client and the agent
|
||||
//! said of themselves, when it connected, how many of its calls are
|
||||
@@ -367,6 +371,12 @@ pub enum CloseOutcome {
|
||||
/// It was open and is closed now: no call on it is running, its
|
||||
/// sessions ended, and another process could open it.
|
||||
Closed,
|
||||
/// It was open and is closed as `Closed` says, but its last backup
|
||||
/// wasn't whole (a target that couldn't be reached, git that failed, or
|
||||
/// a backup stopped after its time): why, in words. The books on disk
|
||||
/// are whole; what they hold since the last good backup is not backed
|
||||
/// up.
|
||||
ClosedBackupIncomplete(String),
|
||||
/// It was not open (closed already, or it never opened): nothing was
|
||||
/// done.
|
||||
WasNotOpen,
|
||||
|
||||
Reference in new issue
Block a user