Skip to content

0.9.45

Choose a tag to compare

@github-actions github-actions released this 25 Oct 21:47
· 623 commits to main since this release

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/workflows and get the running Atomic's module, so SqlRunJournal subclasses and journal errors such as StaleLeaseError work instead of failing with Storage unavailable (#3963, #3969)
  • Fast status, resume and receipts for custom journals: a run journal that implements the optional changeToken(), runVersions(), snapshotTail() and appendMany() 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

  • StorageProvider journal factories accept hostModules, and loadStorageAdapter() takes an optional third hostModules argument, to give adapter modules extra live host modules by specifier (#3963)
  • The RunJournal interface in @bastani/atomic/storage has optional changeToken(), runVersions(), snapshotTail() and appendMany() members, with the RunVersion, RunSnapshotTail and RunJournalBatchAppend types. A run journal from a storage adapter, or any custom RunJournal, that implements them gets the same faster /workflow status, resume and batched delivery receipts as the built-in SQL journal, and registerRunJournalConformance checks them when present (#3964)

Fixed

  • A journal adapter loaded by path (ATOMIC_WORKFLOWS_JOURNAL, workflows.journal, or a run's journal: { adapter }) can now import @bastani/atomic/workflows. It gets the workflows module of the running Atomic that opened the journal, so an openRunJournal hook can build on SqlRunJournal and its errors, such as StaleLeaseError, pass Atomic's instanceof checks. Before, the import resolved to a path inside dist/index.js and the journal failed with Storage unavailable (#3963)
  • A large local worker pool no longer fails at startup with Local worker startup timed out after 30000 ms on a small or busy machine. When localWorkers.startupTimeoutMs is 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 names workflows.localWorkers.startupTimeoutMs (#3962)