mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-09-11 04:00:38 +00:00
Write handles now hold a durable lease (session.lock.json beside the log): a random owner token, diagnostic pid, and an expiry. Acquisition wins by exclusive create; a second process's create or write open rejects while the record is unrenewed for less than leaseTtlMs (default 5 min), and takes over after that — a crashed holder is waited out, never reclaimed by pid. The holder renews every leaseRenewIntervalMs (default 4 min); a renewal that finds a foreign, vanished, or expired record — or fails outright — marks the lease lost permanently, so every later append/flush rejects with SessionOwnershipLostError while reads continue. Close releases the record; read handles never touch it. Takeover of an expired record is eventually exclusive: a replaced holder stops within one renewal interval. Refs #3245