Repository navigation
0.9.55
Local worker pools on remote databases, and sturdier start-up on busy and Windows machines.
- Worker pools on any journal: local worker pools (
workflows.localWorkers) now run when the workflow journal is a libSQL or Turso database or another journal adapter, not only the default local SQLite file. Runs and events go to the journal; the pool's queue, leases and pooled-stage sessions stay in a local database on your machine (#4128) - Intercom that starts when the machine is busy: a new broker gets 30 seconds to start (
brokerStartupTimeoutMs), a broker that crashes at start-up is reported at once on Windows too, and a session that connects as its broker retires reconnects instead of failing (#4126) - Session writes on Windows: a session lock directory Windows won't remove at once no longer fails a write or holds up the next one for ten seconds (#4124)
- libSQL files shared between processes: a
file:database opened through@bastani/atomic-storage-libsqlwaits for another process's lock instead of failing
Full changelog
Added
- Local worker pools (
workflows.localWorkers,RunOpts.localWorkers) now work when the workflow journal is not the default local SQLite file: a libSQL or Turso database, any other storage adapter, or a SQLite file with a custom prefix. The workers open the same journal the root uses, and the pool keeps its work queue, leases, admission state and worker logs in a SQLite file under~/.atomic/workflows/pool/. A pooled root on such a journal resumes on the machine where it ran; resuming it elsewhere fails with an error naming that machine. A memory journal and a journal passed to the SDK as an object still cannot host workers.
Fixed
- Fixed a session write failing, or the next write waiting up to ten seconds, on Windows when the session lock directory could not be removed at once because another program, such as a virus scanner or file indexer, held it. The release is now retried, and a lock Atomic still cannot remove is cleared by the next write instead of waiting to go stale
- Intercom no longer fails to start on a busy machine or with an empty jiti cache because the broker was still starting. A new broker now gets 30 seconds, not 5, to answer on its socket. That is sized from measured start-up: 0.5 s on an idle machine, 2.6 s with five processes per core, and 8.7 s, 15 s and 28 s with an empty jiti cache at five, nine and seventeen.
brokerStartupTimeoutMsin the Intercomconfig.jsonchanges it, and theBroker failed to start within timeouterror now names that setting. On Windows, a broker that crashes during start-up is reported as soon as it exits, with its log, instead of after that whole budget: the broker writes its own pid tobroker.startingin the Intercom directory as its first act, and the session that spawned it watches that process. Only a broker that is alive and not yet listening is waited for the full budget. - A session that connects as the broker retires, whether idle for its window, shut down or replaced, no longer fails with
Connection closed before registrationorconnect ENOENT. A broker that is closing answers a registration withbroker_retiringinstead of accepting a session it is about to drop, including one still waiting for its multi-node presence write when the shutdown begins. A connection that ended before the broker answered, with nothing answering on its socket any more, is a recoverable disconnect. The session spawns the replacement broker and registers again for up to ten seconds, so a child session's launch and a workflow stage's warm-up no longer fail on the race. - A
file:database opened through the adapter now waits up to 5 seconds for a lock another connection holds, and uses the write-ahead log like Atomic's own SQLite stores. Several processes can write one file, for example a workflow root, its coordinator and its workers; before, they lost statements to each other at once withSQLITE_BUSY: database is locked. The first open changes an existing file to WAL mode.