Repository navigation
0.9.45
Custom storage adapters now plug into workflow journals as first-class citizens, and large local worker pools start reliably on busy machines.
- Journal adapters that build on Atomic's own journal: a storage adapter loaded by path can import
@bastani/atomic/workflowsand get the running Atomic's module, soSqlRunJournalsubclasses and journal errors such asStaleLeaseErrorwork instead of failing withStorage unavailable(#3963, #3969) - Fast status, resume and receipts for custom journals: a run journal that implements the optional
changeToken(),runVersions(),snapshotTail()andappendMany()members gets the same faster/workflow status, resume and batched delivery receipts as the built-in SQL journal (#3964, #3968) - Worker pools that start on small or busy machines: without an explicit
workflows.localWorkers.startupTimeoutMs, the startup deadline scales with pool size and machine load instead of failing after 30 s (#3962, #3965)
Full changelog
Added
StorageProviderjournal factories accepthostModules, andloadStorageAdapter()takes an optional thirdhostModulesargument, to give adapter modules extra live host modules by specifier (#3963)- The
RunJournalinterface in@bastani/atomic/storagehas optionalchangeToken(),runVersions(),snapshotTail()andappendMany()members, with theRunVersion,RunSnapshotTailandRunJournalBatchAppendtypes. A run journal from a storage adapter, or any customRunJournal, that implements them gets the same faster/workflow status, resume and batched delivery receipts as the built-in SQL journal, andregisterRunJournalConformancechecks them when present (#3964)
Fixed
- A journal adapter loaded by path (
ATOMIC_WORKFLOWS_JOURNAL,workflows.journal, or a run'sjournal: { adapter }) can now import@bastani/atomic/workflows. It gets the workflows module of the running Atomic that opened the journal, so anopenRunJournalhook can build onSqlRunJournaland its errors, such asStaleLeaseError, pass Atomic'sinstanceofchecks. Before, the import resolved to a path insidedist/index.jsand the journal failed withStorage unavailable(#3963) - A large local worker pool no longer fails at startup with
Local worker startup timed out after 30000 mson a small or busy machine. WhenlocalWorkers.startupTimeoutMsis not set, the readiness deadline now scales with the number of workers and the 1-minute load average per CPU core, from 30000 ms up to 600000 ms; on an idle machine with spare cores it stays 30000 ms. If workers still miss the deadline, the error now says they were too slow to start and namesworkflows.localWorkers.startupTimeoutMs(#3962)