Skip to content

Releases: photostructure/batch-cluster.js

Release 17.3.1

21 Feb 00:07
Immutable release. Only release title and notes can be modified.
v17.3.1
12d5c66

Choose a tag to compare

  • 🐞 Fixed orphaned child processes after end(). When end() was called (either explicitly or via the beforeExit handler), the synchronous process.on("exit") SIGKILL backstop was removed before async cleanup completed. If the parent process exited before graceful termination finished, child processes survived as orphans. The fix snapshots live PIDs before cleanup begins and keeps the backstop registered until async teardown succeeds.

Commits

  • chore(dependabot): deleted (f9660ab)
  • fix: resolve orphaned child processes after end() in BatchCluster (c5a4cc1)
  • chore: update CodeQL action versions to v4.32.4 (0d940fd)
  • feat: add handoff and TPP skills documentation; update CLAUDE.md with TPP workflow (e1ee3b8)
  • chore(deps): update typedoc to version 0.28.17 and typescript-eslint to version 8.56.0 (d8ddaac)

Release 17.3.0

07 Feb 05:55
Immutable release. Only release title and notes can be modified.
v17.3.0
039e6a5

Choose a tag to compare

  • ✨ Added findStreamFlushMillis() to auto-discover the minimum reliable streamFlushMillis value for a given child process on the current operating system and hardware. Uses a three-phase search (coarse binary search, validation, confirmation); callers should apply their own additive headroom for load spikes.

Commits

  • fix(BatchCluster): prevent infinite loop in setMaxProcs test on slow CI (590b820)
  • refactor(Task): remove waitForStderrMillis in favor of single streamFlushMillis (3b0fdd0)
  • chore(test): add exiftool threshold test (e471116)
  • feat(FindFlushThresholds): add auto-discovery for optimal flush delay values (a363528)
  • chore: replace ts-node with tsx (833b33d)
  • test(BatchCluster): reduce test matrix runtime by ~50% (2cbdb60)
  • feat(Task): add waitForStderrMillis for directional stream flush delays (a639aed)
  • chore(fmt) (fc80ef2)

Release 17.2.0

06 Feb 20:48
Immutable release. Only release title and notes can be modified.
v17.2.0
59b206a

Choose a tag to compare

  • ✨ Added exitCode and exitSignal properties to BatchProcess that are always populated when a child process exits. Access these in childEnd event handlers for complete diagnostic information about how processes terminated.

  • ✨ Added unexpectedExit getter to BatchProcess that returns true if the process exited due to a crash, error, or timeout (rather than proactive management like recycling). Use this to distinguish between expected non-zero exit codes and actual problems.

  • ✨ Exported ExpectedTerminationReasons constant listing reasons that indicate managed shutdowns ("worn", "old", "idle", etc.) vs unexpected exits.

Commits

  • feat(BatchProcess): always capture exit diagnostics and add unexpectedExit property (8ea70d6)
  • test(BatchCluster): fix flaky maxIdleMsPerProcess test on Mac (780f553)
  • test: enhance exitCode and exitSignal assertions for cross-platform compatibility (a34cb6c)
  • feat: add exitCode and exitSignal properties to BatchProcess for better process termination handling (70a0ab7)
  • docs: add verification requirements for external references in CLAUDE.md (cefd320)
  • chore: update dependencies in package.json (8b86abb)
  • chore(workflows): update CodeQL action versions to v4.32.2 (4627bed)
  • feat: add settings.json for Bash permissions to allow git fetch commands (aec8cf5)
  • chore(workflows): update actions/checkout and CodeQL action versions to latest (375f60f)
  • chore(deps): update @types/node, prettier, and release-it to latest versions (ea88ab3)

Release 17.1.0

16 Jan 05:51
Immutable release. Only release title and notes can be modified.
v17.1.0
86a8c8f

Choose a tag to compare

  • ✨ Added cleanupChildProcsOnExit option (defaults to true) to control whether BatchCluster registers beforeExit and exit handlers for automatic child process cleanup.

    Set to false if you want to manage process cleanup yourself, or if these handlers interfere with your application's exit behavior.

  • 🐞 Fixed the exit handler to synchronously kill child processes. The previous implementation called an async method, which doesn't work in exit handlers (only synchronous operations are allowed).

Commits

  • feat: ensure sufficient iterations for statistical reliability in BatchCluster tests (608a19a)
  • feat: add cleanupChildProcsOnExit option for automatic child process cleanup on exit. Fix #exitListener to be sync. (ab9a59c)
  • chore(deps): update npm-check-updates, release-it, and typedoc to latest versions (e84727f)
  • chore(workflows): update setup-node and CodeQL action versions to latest (618d2b4)

Release 17.0.0

09 Jan 05:02
Immutable release. Only release title and notes can be modified.
v17.0.0
f2dea04

Choose a tag to compare

  • 💔 BREAKING: Added unrefStreams option (defaults to true) that unreferences child process stdio streams.

    Previously, even though proc.unref() was called on child processes, the stdio streams (stdin, stdout, stderr) kept the parent Node.js process alive, requiring explicit .end() calls.

    With unrefStreams: true (the new default), scripts can now exit naturally without calling .end(). Child processes are cleaned up automatically when the parent exits.

    To restore the previous behavior where the parent process stays alive until .end() is called:

    new BatchCluster({ unrefStreams: false, ... });

    Fixes exiftool-vendored#319.

Commits

  • feat: add unrefStreams option to BatchCluster for automatic cleanup of child process streams (7f39790)
  • chore(deps): update globals to version 17.0.0 in package.json and package-lock.json (1dea614)
  • chore(deps): update devDependencies to latest versions (0ff9bab)
  • chore(workflows): update GitHub Actions to latest versions for SSH signing and CodeQL analysis (ffc8c5c)
  • chore(fmt) (dd6f074)
  • chore(deps): update npm-check-updates, prettier, and release-it to latest versions (94135e1)
  • chore(deps): switch from abandoned npm-run-all to npm-run-all2 (b356416)
  • fix(CHANGELOG): update version headers to include links for v16.0.0, v15.0.1, v15.0.0, and v14.0.0 (5c5d2c3)

Release 16.0.0

05 Dec 02:38
v16.0.0
09e47d2

Choose a tag to compare

  • fix(BatchCluster.spec): disable random failures in leaky factory test (e0b07c4)
  • fix(BatchCluster.spec): resolve test and shutdown timeouts with healthCheck (56d759f)
  • fix(BatchCluster): increase shutdown timeout for Windows CI from 30s to 45s due to high process churn (659000a)
  • fix(BatchCluster): adjust timeout for Windows CI to accommodate process spawn overhead (bbfce3d)
  • fix(BatchCluster): measure spawn time before tests to reduce overhead and allow tolerance in process count expectations (d85904f)
  • fix(BatchCluster): measure spawn time to set realistic timeouts for tasks (b7ed938)
  • fix(gitattributes): add configuration for Unix-style line endings and binary files (8d8e1fb)
  • fix(package): improve update:actions script to handle pinact installation check (b73c511)
  • fix(BatchProcessOptions): enhance documentation for versionCommand (561fd64)
  • fix(BatchCluster): disable random failures in one factory rejection test (842f330)
  • fix(settings): add permission for GitHub API commands (3b71e89)
  • fix(BatchCluster): implement retry logic for task enqueueing on EUNLUCKY errors (4001fe7)
  • fix(package): ignore-scripts makes pre script hooks not fire! (4c385f7)
  • fix(BatchProcess): add clarifying comment that we skip clearing timeout for non-current tasks (d00870e)
  • fix(package): update precommit script to include clean, fmt, and lint tasks (b1f1e17)
  • chore(delint) (534b46d)
  • refactor(TaskQueueManager): simplify task assignment logic by removing retries parameter and improving requeue handling (c5d5e56)
  • fix(Task): simplify resolution logic in #resolve method to handle multiple resolutions correctly (4ff5be2)
  • fix(BatchCluster): remove redundant logger assignment to streamline initialization (768884b)
  • fix(BatchProcess): ensure process ends on stdin.write errors to prevent broken processes in the pool (1309113)
  • refactor(ChildProcessFactory): enhance documentation for processFactory to clarify error handling and resource management (8c059a3)
  • refactor(Deferred): update rejection behavior to ignore subsequent rejections after resolution (a1d7b4e)
  • breaking: remove fatalError event and related tests to simplify error handling (2eacb3d)
  • chore(fmt) (43a9c58)
  • breaking: remove unused Rate class (a0b2b1e)
  • breaking: Removed maxReasonableProcessFailuresPerMinute option and fatal shutdown on spawn failures (e512cc5)
  • refactor(BatchCluster.spec): standardize healthcheck variable naming and remove console logs (095ed7a)
  • fix(BatchProcess): emit startError only for actual startup task failures (86cf57e)
  • feat(BatchClusterOptions): update taskTimeoutMillis default to 0 and improve validation comments (62fe197)
  • refactor(Rate): simplify event rate calculation and memory usage with two-bucket sliding window (51f1acd)
  • chore(build): add Node.js version 25 to the build matrix (7ebdb2e)
  • fix(BatchCluster): return task promise when enqueueing fails (8591756)
  • docs: add SIMPLE-DESIGN, TDD, and TPP-GUIDE documentation (76491e3)
  • chore(fmt) (249caba)
  • refactor: standardize fail rate function naming and improve test environment handling (544b2b8)
  • chore(dependencies): update typedoc to version 0.28.15 in package.json and package-lock.json (e28c8bc)
  • fix(workflows): update actions/checkout and actions/setup-node to latest versions in build, codeql-analysis, and docs workflows (43e8079)
  • chore: add .npmrc to disable lifecycle scripts for security hardening (ab2f019)
  • chore: update devDependencies to latest versions (54bff02)
  • fix(workflows): update actions/checkout and actions/setup-node to v6.0.0 in build, codeql-analysis, and docs workflows (b1355e0)
  • chore(dependencies): update npm-check-updates and ESLint dependencies; refine Dependabot and ncu config to include cooldown (becf4ba)
  • fix(workflow): update setup-node action to v5.0.0 in build, codeql-analysis, and docs workflows (5b151ff)
  • fix(workflow): update macOS version and node version format in build matrix (should be no-op) (5d3e194)

Release 15.0.1

26 Aug 00:38
v15.0.1
5cfc0f4

Choose a tag to compare

"This time, with feeling"

  • 📦 v15.0.0 automated the release to use OIDC 👍, but the compile prerequisite was missed 🤦, so v15.0.0 has no code in it 🪹.

Commits

  • chore(changelog): add entry for v15.0.1 to clarify release issues (98b1561)
  • fix(workflow): update pre-init hooks to use npm ci, clean, and compile (253d3a5)

Release 15.0.0

25 Aug 22:11
v15.0.0
093520f

Choose a tag to compare

Release 15.0.0 Pre-release
Pre-release
  • 💔 Deleted the standalone pids() function and associated code (including the ProcpsChecker). This function was exported but only used internally by tests. This fixes the issue #58 (by deleting the unused code! the best kind of bugfix). Thanks for the report, Zaczero!

  • 💔 Dropped official support for Node v23, which is EOL.

  • 📦 Simplified prettier config to accept all defaults -- this added semicolons to every file.

Commits

  • fix(workflow): add step to update npm to the latest version (37ec2f7)
  • fix(package): add publishConfig for public access and provenance (55d7913)
  • chore(fmt): prettier (a318216)
  • fix(package): update repository URL format and enhance formatting scripts (cc281fd)
  • fix(tests): improve shutdown timeout handling for CI environments (f8ceca3)
  • chore(workflow): rename node.js.yml to build.yml (bbfbfc5)
  • refactor(release): consolidate release workflow into node.js.yml and remove redundant release.yml (7737d20)
  • chore(deps): npm run update (ef0542c)
  • fix(release): update release workflow and package.json for OIDC trusted publishing (be620e4)
  • fix(release): debug OIDC release (6e40c86)
  • fix(release): consolidate permissions and add npm update/check steps (c7ac742)
  • fix(release): migrate to OIDC/remove NODE_AUTH_TOKEN (9bfe914)
  • fix(settings): add WebFetch permission for npmjs.com documentation (19498c4)
  • chore(release): OIDC (ee585df)
  • chore(settings): add 'Millis' and 'photostructure' to cSpell.words (9c0d213)
  • fix(ProcessTerminator): remove Windows-specific timeout adjustment in awaitNotRunning function (c0eb184)
  • fix(BatchProcess): correct spelling of lastJobFinishedAt and update process exit handling to use Deferred (32be80d)
  • fix(BatchCluster): change checkShutdown to synchronous function and remove unnecessary await for currentTestPids (b024e6e)
  • feat(Pids): enhance pidExists function with optional kill function parameter. Add tests. (63355a3)
  • chore(health): rename maybeRunHealthcheck to maybeRunHealthCheck (27d5a1a)
  • fix(ProcessTerminator): adjust timeout for Windows process cleanup (888d0e8)
  • fix(pidExists): handle Windows-specific error codes for process existence check (e7248ce)
  • feat: add release script and GitHub Actions workflow for automated releases (8db8503)
  • fix(changelog): drop official support for Node v23, which is EOL (0204bd8)
  • chore(fmt): accept prettier defaults (enables semicolons) (53bd6f2)
  • chore(fmt): use inline export type {} from ... instead of import/export type (8e54150)
  • chore(fmt) (fff8058)
  • fix(docs): update serve command to use the correct build path for documentation (94cd48a)
  • fix(procps): remove unused ProcpsChecker and related tests; refactor BatchCluster to eliminate procps dependency. Fixes #58 (856d641)
  • chore: update devDependencies to latest versions (9fde021)
  • chore: update GitHub Actions to use latest versions of checkout and setup-node (920e462)
  • chore(dep): shush (6a9be5b)
  • chore(pkg): ncu (c4d76ef)
  • chore(gha): pinact (4da6803)
  • chore: update git-ssh-signing-action to v1.0.0 (f91b0c2)
  • chore(fmt) (56f9835)
  • chore(pkg): ncu -u (2da0f5d)
  • chore(docs): remove caution section regarding cleanupChildProcs (we don't need procps anymore) (3bc72ba)
  • chore(docs): fix script (4b261b8)
  • pin github actions to SHAs (ca422b7)
  • chore(pkg): set up automatic updates via precommit (8f0ca36)
  • chore(docs): merge configs (62a022f)
  • chore(test): improve test stability on windows in BatchCluster.spec.ts (9295272)
  • chore: update devDependencies for eslint, mocha, typescript-eslint, and @types/node (b218408)
  • chore: remove redundant header from README and add typedoc configuration (1e1e4b2)
  • chore(art): logo (ff233f5)
  • chore: update dependencies for eslint and typescript (a1b9805)
  • chore: remove unused constant declaration for HealthCheckable (5937211)
  • Bump actions/setup-node from 4.2.0 to 4.4.0 (87a95b7)
  • Bump github/codeql-action from 2 to 3 (26884af)
  • chore: update @types/node and typescript-eslint to latest versions (b3f69cd)
  • chore(docs): remove warnings by exposing types that are part of the public API (3330144)
  • feat(docs): switch to GHA (6d8f8b6)

Release 14.0.0

26 May 19:31
49f8eba

Choose a tag to compare

  • 💔 Dropped official support for Node v14, v16, and v18. Minimum Node.js version is now v20.

  • ✨ Added startup validation for procps availability: BatchCluster now throws ProcpsMissingError during construction if the required ps command (or tasklist on Windows) is not available. This provides clear, actionable error messages instead of cryptic runtime failures. Resolves #13 and #39.

  • 📦 Significant internal refactoring to improve maintainability:

    • Extracted process management logic into dedicated classes (ProcessPoolManager, TaskQueueManager, ProcessHealthMonitor, StreamHandler, ProcessTerminator)
    • Implemented strategy pattern for health checking logic
    • Improved type safety by replacing any with unknown throughout the codebase
    • Enhanced error handling and process lifecycle management

Full Changelog: v13.0.0...v14.0.0

Release 13.0.0 🍀

10 Feb 05:57
fa13601

Choose a tag to compare

  • 💔 Dropped official support for Node v16, which is EOL.

  • 💔 Several methods, including BatchCluster#pids() were changed from async to sync (as they were needlessly async).

  • 📦 A number of timeout options can now be validly 0 to disable timeouts:

    • spawnTimeoutMillis
    • taskTimeoutMillis
  • 📦 Added eslint @typescript-eslint/await-thenable rule and delinted.

  • 📦 Updated development dependencies and rebuilt docs

Commits

  • update GHA (bcd4b8c)
  • rebuild docs (c7fa114)
  • Attempt to avoid EPIPE on child process end. Verify that maxProcAgeMillis, taskTimeoutMillis, and spawnTimeoutMillis can be 0. (65bb31d)
  • err may be null (1f69cb3)
  • use new macos-14 images (a3ce931)
  • handle zero timeouts as don't-timeout (a674f59)
  • no need to await (f62d4d5)
  • verify that we're not escalating an SIGPIPE to callers (797774e)
  • pre v13 (4fc97db)
  • ncu -u (06bf7af)
  • add await-thenable linting (01ca551)
  • fix jsdoc (1e42148)
  • node 16 is EOL (2154ac5)
  • pesky chai went ESM (585c9f0)
  • HNY (26cb0a0)
  • diffs from new prettier (867a5c5)
  • update dev deps (852f06a)
  • add lint job (dd2c21e)
  • Update node imports to include "node:" prefix. Replace NodeJS.Timer references with NodeJS.Timeout. (029a7fd)
  • drop node 14 support (77062c3)
  • Switch to prettier-plugin-organize-imports and apply. (23f3295)
  • ncu -u (0144af3)
  • yarn docs (a73db0e)
  • ncu -u (a6032ce)
  • yarn docs (ab78987)
  • ncu -u (9519dc4)
  • add node 20 to build matrix (c630341)

Full Changelog: v12.1.0...v13.0.0