@zukhruf/pool 0.8.43 → 0.8.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,6 +4,47 @@ Lends long-lived workers to jobs, one job for each worker at a time. A worker is
4
4
 
5
5
  The words in these documents have one meaning each. See the glossary in [CONTEXT.md](./CONTEXT.md).
6
6
 
7
+ ## Use it
8
+
9
+ ```sh
10
+ npm install @zukhruf/pool
11
+ ```
12
+
13
+ ```ts
14
+ import { Fixed, NoEviction, Parallel, Pool, type Worker } from '@zukhruf/pool';
15
+
16
+ class Upper implements Worker<string, string> {
17
+ readonly #exit = Promise.withResolvers<void>();
18
+ async run(input: string): Promise<string> {
19
+ return input.toUpperCase();
20
+ }
21
+ exited(): Promise<void> {
22
+ return this.#exit.promise;
23
+ }
24
+ kill(): void {
25
+ this.#exit.resolve();
26
+ }
27
+ async close(): Promise<void> {
28
+ await this.#exit.promise;
29
+ }
30
+ }
31
+
32
+ await using pool = new Pool({
33
+ size: new Fixed(2),
34
+ startup: new Parallel(),
35
+ eviction: new NoEviction(),
36
+ clock: globalThis,
37
+ create: () => new Upper(),
38
+ });
39
+ const words = await Promise.all(
40
+ ['one', 'two', 'three'].map((word) => pool.use((worker) => worker.run(word))),
41
+ );
42
+ console.log(words, pool.stats);
43
+ // [ 'ONE', 'TWO', 'THREE' ] { starting: 0, idle: 2, lent: 0, waiting: 0 }
44
+ ```
45
+
46
+ The pool starts two workers and lends them to three jobs, one job for each worker at a time. After the jobs, both workers are idle. The disposal at the end of the program stops them.
47
+
7
48
  ## Lend a worker to a job
8
49
 
9
50
  ```ts
@@ -126,7 +167,7 @@ An eviction of your own gets the clock of the pool as the third argument of `idl
126
167
 
127
168
  ## One pool for the computer
128
169
 
129
- Design for review (backlog #3527). `WorkerKind`, `computerStore` and `PoolWorkers` are built. `PoolWorkers` touches each running job every 5 s. It kills the worker of a job at the kind's time limit, and when the store took the job back. It does not yet wake on the "new job" notification, and it has no `stats` and no `ready()` yet. `Pool` with `start`, `handle` and `run` is not built yet, and `use` stays until it is. The text above tells what the package does today. [ADR 0011](./docs/adr/0011-every-pool-is-a-pool-for-the-computer-and-one-owner-pulls-its-jobs-from-a-store-that-every-host-writes-to.md) to [ADR 0026](./docs/adr/0026-start-accepts-a-job-now-and-a-job-handle-reads-its-output-later-from-any-host.md) record the design. The tickets and the research named here are in the pool map, `.scratch/one-pool-for-the-computer/` at the workspace root, which git does not track.
170
+ Design accepted 2026-11-20, partly built (backlog #3527). `WorkerKind`, `computerStore` and `PoolWorkers` are built. `PoolWorkers` touches each running job every 5 s. It kills the worker of a job at the kind's time limit, and when the store took the job back. Its `stats` count the slots of this host, and each count is zero while the host does not own. Its `ready()` resolves when the host owns and the workers that its startup starts are ready. It does not yet wake on the "new job" notification. `Pool` with `start`, `handle` and `run` is not built yet, and `use` stays until it is. The text above tells what the package does today. [ADR 0011](./docs/adr/0011-every-pool-is-a-pool-for-the-computer-and-one-owner-pulls-its-jobs-from-a-store-that-every-host-writes-to.md) to [ADR 0026](./docs/adr/0026-start-accepts-a-job-now-and-a-job-handle-reads-its-output-later-from-any-host.md) record the design. The tickets and the research named here are in the pool map, `.scratch/one-pool-for-the-computer/` at the workspace root, which git does not track.
130
171
 
131
172
  Today each host builds its own pool, so several hosts on one computer run several full pools, and they compete for one Neural Engine (#2896, #3868). In the design, every pool is a pool for the computer. On each computer, one host owns the workers of a pool. Every host writes its jobs to one store, and only the owner takes them. A job is data, so it can go from one host to another. The pool for the computer replaces the pool of today: `use((worker) => …)` goes away.
132
173
 
@@ -310,7 +351,8 @@ export class DisposedError extends Error {}
310
351
  - **A job is data.** The input and the output are JSON. A file goes by reference: a path on one computer. The code of a job is the worker's `run` ([ADR 0012](./docs/adr/0012-a-job-is-data-and-the-worker-kind-runs-it.md)).
311
352
  - **The store** is a required address. A path of a SQLite file is the store of one computer, through [`@zukhruf/sqlite-queue`](../sqlite/queue/README.md). A `postgres://` address joins computers, through pg-boss. `computerStore(env)` gives `zukhruf-pool/store.sqlite` in the user's state folder: `$HOME/Library/Application Support` on macOS, `$XDG_STATE_HOME` (or `$HOME/.local/state`) on Linux, `%LOCALAPPDATA%` on Windows. It reads `process.platform`, and takes `env` as its input, as Go's `os.UserConfigDir` reads `runtime.GOOS`. Every `Pool` and `PoolWorkers` opens the store and creates the queue of its revision ([ADR 0015](./docs/adr/0015-the-store-is-a-required-input-and-computer-store-gives-the-store-of-the-computer.md)).
312
353
  - **The clock.** The store keeps the wall time of each job, so `Pool` and `PoolWorkers` take a `WallClock` of [`@zukhruf/async`](../async/README.md): `globalThis` in production. The pool gives `@zukhruf/sqlite-queue` pg-boss's clock, made from it.
313
- - **A failure of the store** ends the host's campaign or ownership: a standby stops its campaign, and an owner stops fetching, finishes its running jobs, resigns and then closes its workers, and the disposal of `PoolWorkers` rejects with the failure. The jobs stay in the store for the next owner.
354
+ - **A failure of the store** that no caller waits for, in a pass of the store, a fetch, a touch or a settle of the owner, is a process warning, and the owner keeps owning: the next pass, backstop or touch tries again, and a job whose settle failed lapses by its heartbeat and runs again by the kind's rules, as pg-boss emits the failure of a pass and keeps polling. Ownership ends only by the election or the disposal. A store that fails to start ends the host, and the disposal of `PoolWorkers` rejects with that failure.
355
+ - **The disposal** of `PoolWorkers` can run again, or at the same time: each call waits for the one end of the host, which closes the store last.
314
356
  - **The cap.** The owner's sizing caps the jobs of its computer. The store keeps no count of running jobs. A new owner starts its sizing fresh ([ADR 0016](./docs/adr/0016-the-owners-sizing-caps-the-jobs-of-its-computer.md)).
315
357
  - **The owner asks, then takes.** It calls `fetch(name, { batchSize: free })` on the queue of its revision for its free workers, settles each job with `complete` or `fail` by its attempt, and calls `touch` for each running job every 5 s on a heartbeat of 10 s. It fetches when a worker becomes free, at a "new job" wake, and at the backstop ([ADR 0017](./docs/adr/0017-the-owner-asks-then-takes-as-many-jobs-as-it-has-free-workers.md)).
316
358
  - **News travels by push.** Two channels for each pool: "a new job", with the revision, which the owner hears, and "an output", with the job id, which each waiting `Pool` hears. On one computer they go through [`@zukhruf/sqlite-notify`](../sqlite/notify/README.md), across computers through Postgres `LISTEN` / `NOTIFY`. The store is the truth, and a wake only says "read the store". A backstop each second on one computer finds a lost wake, and a job that the store's monitor failed ([ADR 0018](./docs/adr/0018-news-travels-by-push-through-the-notify-of-the-store-with-a-backstop.md)).
@@ -348,7 +390,7 @@ Each gap that the design found goes to the package that must have it, and is bui
348
390
  | `useListenNotify` across instances on one file | `@zukhruf/sqlite-queue` | Built (#4334). The pool does not use it (ADR 0018). |
349
391
  | A standby that polls, and a hung leader that nobody ends | `@zukhruf/election` | Built (#4371) |
350
392
  | An older release that rebuilds a newer file | `@zukhruf/sqlite-queue` | Built (#4369) |
351
- | A count of the jobs of a queue by state, pg-boss's `getQueueStats` | `@zukhruf/sqlite-queue` | Not built. `pool.stats()` needs it (#2888). |
393
+ | A count of the jobs of a queue by state, pg-boss's `getQueueStats` | `@zukhruf/sqlite-queue` | Built (#2888). `pool.stats()` needs it. |
352
394
  | A job from `findJobs` carries a `signal`, and pg-boss's does not | `@zukhruf/sqlite-queue` | Fixed (#4331) |
353
395
  | A write that waits more than the busy timeout of 5 s fails | `@zukhruf/sqlite-queue` | Open risk (#4355) |
354
396
  | A synced commit on macOS is a plain `fsync` | `@zukhruf/sqlite-queue` | Open risk (#4351) |
@@ -372,7 +414,7 @@ Decided by the leaders (Ezz: "I trust your recommendation ... follow the top per
372
414
 
373
415
  A plan, not code. The hosts that move are elt and context-compiler (map, Revision 2026-11-13). trashbot is not in use, stays on `@zukhruf/pool` 0.6.15, and does not move.
374
416
 
375
- 1. **zukhruf, before the pool**: Ezz reviews ADR 0011 to ADR 0026. `@zukhruf/sqlite-queue` gets pg-boss's `getQueueStats(name)` with its parity tests, because `pool.stats()` needs it (#2888). #4331 is fixed.
417
+ 1. **zukhruf, before the pool**: Ezz accepted ADR 0011 to ADR 0026 as built (2026-11-20). `@zukhruf/sqlite-queue` has pg-boss's `getQueueStats(name)` with its parity tests, which `pool.stats()` needs (#2888). #4331 is fixed.
376
418
  2. **zukhruf, the pool**: `WorkerKind`, `Pool` with `start`, `handle` and `run`, `PoolWorkers` and `computerStore`, with tests of several real hosts on one computer: each test with its own store file, real worker processes and the real clock. `use` and its tests go. The recipes change to the new API, and this section becomes the README. Then a release.
377
419
  3. **elt**: a `vision` kind (`exclusive`, with retries) and a `transcription` kind (`standard`) in modules with no native code. The worker classes implement `run`. `ImageFormat` takes a `Pool` of the `vision` kind, in place of `Pool<VisionWorker>` (`image-format.ts:56`). `local-transcription-model.ts:85` gives the path of its wav to `run`.
378
420
  4. **context-compiler**: the server (`apps/server/src/startup.ts:11`) and the CLI (`apps/cli/src/parsing.ts:61`) build a `Pool` and a `PoolWorkers` of the `vision` kind with `computerStore(process.env)`. `packages/connectors/connector/src/transcription.ts:96` does the same for transcription. Each host disposes them at a termination signal, through `@zukhruf/shutdown`.
@@ -381,6 +423,146 @@ A plan, not code. The hosts that move are elt and context-compiler (map, Revisio
381
423
 
382
424
  Many computers come after map ticket 14, when a second computer is real.
383
425
 
426
+ ## Errors
427
+
428
+ These are the errors that the package throws today. The errors of the design are in the section "One pool for the computer".
429
+
430
+ | Error | When |
431
+ | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
432
+ | `RangeError` | `new WorkerKind` gets a name whose channel `<name>.new-job` has 64 bytes or more ([src/worker-kind.test.ts](./src/worker-kind.test.ts)). |
433
+ | `RangeError` | `new IdleTimeout({ after })` gets an `after` that is not above 0 and at most 2,147,483,647 ([src/pool.test.ts](./src/pool.test.ts)). |
434
+ | `TypeError` | `new PoolWorkers` gets a `postgres://` store. Only the store of one computer, the path of a SQLite file, is built ([src/pool-workers.test.ts](./src/pool-workers.test.ts)). |
435
+ | `Error` | `computerStore(env)` finds no `$HOME` on macOS, no `$HOME` and no `$XDG_STATE_HOME` on Linux, or no `%LOCALAPPDATA%` on Windows ([src/computer-store.test.ts](./src/computer-store.test.ts)). |
436
+ | The failure of the store | The disposal of `PoolWorkers` rejects with the failure of the store's start, for example an `expireInSeconds` that the store refuses ([src/pool-workers.test.ts](./src/pool-workers.test.ts)). A later failure of the store is a process warning. |
437
+ | The error of the warm-up | `workers.ready()` of `PoolWorkers` rejects with it when a worker that the startup of the owner starts fails its `ready()` ([src/pool-workers.test.ts](./src/pool-workers.test.ts)). |
438
+ | `AbortError` | `workers.ready()` of `PoolWorkers` rejects with it when you dispose `PoolWorkers` before its host owns ([src/pool-workers.test.ts](./src/pool-workers.test.ts)). |
439
+ | `signal.reason` | `pool.use` rejects with it when its signal aborts. |
440
+ | `AbortError` | `pool.use` rejects with it when you dispose the pool, also for a job that waits ([src/pool.test.ts](./src/pool.test.ts)). |
441
+ | The error of the job | `pool.use` rejects with what `job` throws, for example the error of a worker that exited while the job ran. |
442
+ | The error of the warm-up | `pool.ready()` rejects with it when a worker that the startup starts with the pool fails its `ready()`. When you dispose the pool while such a worker warms up, the pool kills the worker, and `pool.ready()` rejects with the reason that the `ready()` of that worker gives ([src/pool.test.ts](./src/pool.test.ts)). |
443
+
444
+ ## API
445
+
446
+ The exports of today. The section "One pool for the computer" gives the design, which is not all built.
447
+
448
+ ```ts
449
+ import type { Clock, WallClock } from '@zukhruf/async';
450
+
451
+ class Pool<T extends Worker<never, unknown>> implements AsyncDisposable {
452
+ constructor(options: {
453
+ size: Sizing;
454
+ startup: Startup;
455
+ eviction: Eviction;
456
+ create: () => T;
457
+ clock: Clock; // globalThis in production, a fake clock in a test
458
+ });
459
+ ready(): Promise<void>; // the workers that the startup starts with the pool are ready
460
+ get stats(): PoolStats; // a new snapshot at each read
461
+ use<R>(job: (worker: T) => Promise<R>, signal?: AbortSignal): Promise<R>;
462
+ [Symbol.asyncDispose](): Promise<void>; // stops every worker
463
+ }
464
+
465
+ class PoolWorkers<Input, Output> implements AsyncDisposable {
466
+ constructor(options: {
467
+ kind: WorkerKind<Input, Output>;
468
+ store: string; // the path of the store's SQLite file, such as computerStore(process.env)
469
+ clock: WallClock;
470
+ create: () => Worker<Input, Output>;
471
+ size: Sizing;
472
+ startup: Startup;
473
+ eviction: Eviction;
474
+ }); // TypeError: a postgres:// store
475
+ readonly stats: PoolStats; // this host's slots; each count 0 while it does not own
476
+ ready(): Promise<void>; // the host owns and its startup's workers are ready
477
+ [Symbol.asyncDispose](): Promise<void>; // rejects with the failure of the store's start
478
+ }
479
+
480
+ class WorkerKind<Input, Output> {
481
+ constructor(options: {
482
+ name: string;
483
+ revision: number;
484
+ policy: 'standard' | 'exclusive';
485
+ retryLimit: number;
486
+ expireInSeconds: number;
487
+ }); // RangeError: "<name>.new-job" has 64 bytes or more
488
+ readonly name: string;
489
+ readonly revision: number;
490
+ readonly policy: 'standard' | 'exclusive';
491
+ readonly retryLimit: number;
492
+ readonly expireInSeconds: number;
493
+ readonly queue: string; // `<name>.r<revision>`
494
+ }
495
+
496
+ function computerStore(env: Record<string, string | undefined>): string;
497
+
498
+ interface Worker<Input, Output> {
499
+ run(input: Input): Promise<Output>;
500
+ ready?(): Promise<unknown>;
501
+ exited(): Promise<unknown>;
502
+ kill(): void;
503
+ close(): Promise<void>;
504
+ }
505
+
506
+ interface Sizing {
507
+ readonly ceiling: number; // the most workers it may run, decided when the pool is built
508
+ readonly current: number; // the workers it runs now
509
+ readonly kept: number; // the workers it keeps alive, at least current
510
+ record(sample: Sample): void;
511
+ }
512
+
513
+ interface Sample {
514
+ readonly started: number;
515
+ readonly finished: number;
516
+ readonly measurable: boolean;
517
+ }
518
+
519
+ interface Startup {
520
+ readonly eager: boolean;
521
+ turn(settled: Promise<void>): Promise<void>;
522
+ }
523
+
524
+ interface Eviction {
525
+ idle(busy: AbortSignal, evict: () => void, clock: Clock): void;
526
+ }
527
+
528
+ interface Computer {
529
+ availableParallelism(): number;
530
+ availableMemory(): number;
531
+ }
532
+
533
+ interface PoolStats {
534
+ readonly starting: number;
535
+ readonly idle: number;
536
+ readonly lent: number;
537
+ readonly waiting: number;
538
+ }
539
+
540
+ class Fixed implements Sizing {
541
+ constructor(workers: number);
542
+ }
543
+ class Resources implements Sizing {
544
+ constructor(options: { memoryPerWorker: number; computer: Computer });
545
+ }
546
+ class HillClimbing implements Sizing {
547
+ constructor(options: { memoryPerWorker: number; computer: Computer });
548
+ }
549
+ class Gradient implements Sizing {
550
+ constructor(options: { memoryPerWorker: number; computer: Computer });
551
+ }
552
+
553
+ class OnDemand implements Startup {}
554
+ class Parallel implements Startup {}
555
+ class OrderedReady implements Startup {}
556
+ class LeaderFirst implements Startup {}
557
+
558
+ class NoEviction implements Eviction {}
559
+ class IdleTimeout implements Eviction {
560
+ constructor(options: { after: number }); // RangeError: unless 0 < after <= 2147483647
561
+ }
562
+ ```
563
+
564
+ `HillClimbing` and `Gradient` extend a class that the package does not export ([src/climbing.ts](./src/climbing.ts)).
565
+
384
566
  ## Recipes
385
567
 
386
568
  1. [Let the pool find how many workers pay](./docs/recipes/find-how-many-workers-pay.md)
@@ -1 +1 @@
1
- {"version":3,"file":"idle-timeout.d.ts","sourceRoot":"","sources":["../src/idle-timeout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAS,MAAM,gBAAgB,CAAC;AAEnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAS9C,qBAAa,WAAY,YAAW,QAAQ;;gBAG9B,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE;IAYtC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,IAAI,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;CAM/D"}
1
+ {"version":3,"file":"idle-timeout.d.ts","sourceRoot":"","sources":["../src/idle-timeout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAS,MAAM,gBAAgB,CAAC;AAEnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAS9C,qBAAa,WAAY,YAAW,QAAQ;;gBAG9B,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE;IAYtC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,IAAI,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;CAW/D"}
@@ -18,7 +18,10 @@ export class IdleTimeout {
18
18
  // An abort stops the timer, also an abort before the call, as when the
19
19
  // owner disposed the pool while the worker became ready. The rejection of
20
20
  // the wait is the abort.
21
- delay(this.#after, { clock, signal: busy }).then(evict, () => { });
21
+ delay(this.#after, { clock, signal: busy }).then(evict, (error) => {
22
+ if (error !== busy.reason)
23
+ throw error;
24
+ });
22
25
  }
23
26
  }
24
27
  //# sourceMappingURL=idle-timeout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"idle-timeout.js","sourceRoot":"","sources":["../src/idle-timeout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAInD,sEAAsE;AACtE,MAAM,OAAO,GAAG,aAAa,CAAC;AAE9B,6EAA6E;AAC7E,8EAA8E;AAC9E,2EAA2E;AAC3E,QAAQ;AACR,MAAM,OAAO,WAAW;IACb,MAAM,CAAS;IAExB,YAAY,OAA0B;QACpC,IACE,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC;YAC/B,OAAO,CAAC,KAAK,IAAI,CAAC;YAClB,OAAO,CAAC,KAAK,GAAG,OAAO;YAEvB,MAAM,IAAI,UAAU,CAClB,0CAA0C,OAAO,YAAY,OAAO,CAAC,KAAK,EAAE,CAC7E,CAAC;QACJ,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAC9B,CAAC;IAED,IAAI,CAAC,IAAiB,EAAE,KAAiB,EAAE,KAAY;QACrD,uEAAuE;QACvE,0EAA0E;QAC1E,yBAAyB;QACzB,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACpE,CAAC;CACF"}
1
+ {"version":3,"file":"idle-timeout.js","sourceRoot":"","sources":["../src/idle-timeout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAInD,sEAAsE;AACtE,MAAM,OAAO,GAAG,aAAa,CAAC;AAE9B,6EAA6E;AAC7E,8EAA8E;AAC9E,2EAA2E;AAC3E,QAAQ;AACR,MAAM,OAAO,WAAW;IACb,MAAM,CAAS;IAExB,YAAY,OAA0B;QACpC,IACE,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC;YAC/B,OAAO,CAAC,KAAK,IAAI,CAAC;YAClB,OAAO,CAAC,KAAK,GAAG,OAAO;YAEvB,MAAM,IAAI,UAAU,CAClB,0CAA0C,OAAO,YAAY,OAAO,CAAC,KAAK,EAAE,CAC7E,CAAC;QACJ,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAC9B,CAAC;IAED,IAAI,CAAC,IAAiB,EAAE,KAAiB,EAAE,KAAY;QACrD,uEAAuE;QACvE,0EAA0E;QAC1E,yBAAyB;QACzB,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAC9C,KAAK,EACL,CAAC,KAAc,EAAE,EAAE;YACjB,IAAI,KAAK,KAAK,IAAI,CAAC,MAAM;gBAAE,MAAM,KAAK,CAAC;QACzC,CAAC,CACF,CAAC;IACJ,CAAC;CACF"}
@@ -1,5 +1,6 @@
1
1
  import { type WallClock } from '@zukhruf/async';
2
2
  import type { Eviction } from './eviction.ts';
3
+ import type { PoolStats } from './pool-stats.ts';
3
4
  import type { Sizing } from './sizing.ts';
4
5
  import type { Startup } from './startup.ts';
5
6
  import type { WorkerKind } from './worker-kind.ts';
@@ -28,6 +29,13 @@ export declare class PoolWorkers<Input, Output> implements AsyncDisposable {
28
29
  startup: Startup;
29
30
  eviction: Eviction;
30
31
  });
32
+ /** This host's slots: zero in each count while it does not own (ADR 0013). */
33
+ get stats(): PoolStats;
34
+ /**
35
+ * Resolves when this host owns and the workers that its startup starts are
36
+ * ready, and rejects when one of them fails to start (ADR 0013).
37
+ */
38
+ ready(): Promise<void>;
31
39
  [Symbol.asyncDispose](): Promise<void>;
32
40
  }
33
41
  //# sourceMappingURL=pool-workers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pool-workers.d.ts","sourceRoot":"","sources":["../src/pool-workers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,SAAS,EAAS,MAAM,gBAAgB,CAAC;AAGrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAoB1C;;;;;;;;;;GAUG;AACH,qBAAa,WAAW,CAAC,KAAK,EAAE,MAAM,CAAE,YAAW,eAAe;;gBAgBpD,OAAO,EAAE;QACnB,IAAI,EAAE,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAChC,4FAA4F;QAC5F,KAAK,EAAE,MAAM,CAAC;QACd,4FAA4F;QAC5F,KAAK,EAAE,SAAS,CAAC;QACjB,MAAM,EAAE,MAAM,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACpC,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,QAAQ,CAAC;KACpB;IA8MK,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ7C"}
1
+ {"version":3,"file":"pool-workers.d.ts","sourceRoot":"","sources":["../src/pool-workers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,SAAS,EAAS,MAAM,gBAAgB,CAAC;AAGrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA6B1C;;;;;;;;;;GAUG;AACH,qBAAa,WAAW,CAAC,KAAK,EAAE,MAAM,CAAE,YAAW,eAAe;;gBAkBpD,OAAO,EAAE;QACnB,IAAI,EAAE,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAChC,4FAA4F;QAC5F,KAAK,EAAE,MAAM,CAAC;QACd,4FAA4F;QAC5F,KAAK,EAAE,SAAS,CAAC;QACjB,MAAM,EAAE,MAAM,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACpC,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,QAAQ,CAAC;KACpB;IAuBD,8EAA8E;IAC9E,IAAI,KAAK,IAAI,SAAS,CAErB;IAED;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAwNhB,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;CAI7C"}
@@ -4,6 +4,9 @@ import { Slots } from "./slots.js";
4
4
  import { Store, TOUCH_INTERVAL } from "./store.js";
5
5
  // The read of the store that finds the jobs that no wake told of (ADR 0018).
6
6
  const BACKSTOP = 1_000;
7
+ const STANDBY = {
8
+ stats: () => ({ starting: 0, idle: 0, lent: 0, waiting: 0 }),
9
+ };
7
10
  /**
8
11
  * Offers this host's workers of one kind, and owns them while this host
9
12
  * leads the election of the kind's store (ADR 0013). A standby starts no
@@ -25,11 +28,13 @@ export class PoolWorkers {
25
28
  #store;
26
29
  #election;
27
30
  #disposed = new AbortController();
28
- // Aborts with the first failure of the store: the host then stops owning.
29
- #failed = new AbortController();
30
31
  // Settles when the host stops offering its workers, and fails with the
31
32
  // failure that stopped it, if one did.
32
33
  #ended;
34
+ // Settles at the first term, by the startup of its workers. A host that
35
+ // stops offering its workers before that rejects it.
36
+ #ready = new Future();
37
+ #role = STANDBY;
33
38
  constructor(options) {
34
39
  this.#kind = options.kind;
35
40
  this.#clock = options.clock;
@@ -38,9 +43,8 @@ export class PoolWorkers {
38
43
  this.#startup = options.startup;
39
44
  this.#eviction = options.eviction;
40
45
  this.#store = new Store(options.store, options.clock);
41
- const fail = (error) => this.#failed.abort(error);
42
- this.#store.queue.on('error', fail);
43
- this.#store.notifications.on('error', fail);
46
+ this.#store.queue.on('error', warn);
47
+ this.#store.notifications.on('error', warn);
44
48
  this.#election = new SqliteElection({
45
49
  directory: this.#store.folder,
46
50
  claimFile: `${options.kind.name}.claim`,
@@ -48,9 +52,24 @@ export class PoolWorkers {
48
52
  clock: options.clock,
49
53
  });
50
54
  this.#ended = Future.run(() => this.#live());
55
+ this.#ended.wait().then(() => this.#ready.reject(this.#disposed.signal.reason), (error) => this.#ready.reject(error));
51
56
  }
57
+ /** This host's slots: zero in each count while it does not own (ADR 0013). */
58
+ get stats() {
59
+ return this.#role.stats();
60
+ }
61
+ /**
62
+ * Resolves when this host owns and the workers that its startup starts are
63
+ * ready, and rejects when one of them fails to start (ADR 0013).
64
+ */
65
+ ready() {
66
+ return this.#ready.wait();
67
+ }
68
+ // Offers the workers until the disposal, and then closes the store, so
69
+ // every disposal waits for the one end. A store that fails to start ends
70
+ // the host with its failure.
52
71
  async #live() {
53
- const stop = AbortSignal.any([this.#disposed.signal, this.#failed.signal]);
72
+ const stop = this.#disposed.signal;
54
73
  try {
55
74
  await this.#store.start(this.#kind);
56
75
  while (!stop.aborted) {
@@ -66,7 +85,9 @@ export class PoolWorkers {
66
85
  if (error !== this.#disposed.signal.reason)
67
86
  throw error;
68
87
  }
69
- this.#failed.signal.throwIfAborted();
88
+ finally {
89
+ await this.#store[Symbol.asyncDispose]();
90
+ }
70
91
  }
71
92
  // Owns until the stop, or until the term is lost: then it campaigns again.
72
93
  async #own(term, stop) {
@@ -82,19 +103,30 @@ export class PoolWorkers {
82
103
  clock: this.#clock,
83
104
  resized: () => changed.broadcast(),
84
105
  });
106
+ // The jobs that wait for this host's workers wait in the store, so no
107
+ // job waits in the host itself.
108
+ this.#role = { stats: () => slots.stats(0) };
109
+ slots.ready().then(() => this.#ready.resolve(), (error) => this.#ready.reject(error));
85
110
  // Whether the last fetch took every job it asked for, so more may wait.
86
111
  let backlog = false;
87
112
  try {
88
113
  while (!owning.aborted) {
89
114
  const free = this.#size.current - running.size;
90
115
  if (free > 0) {
91
- const jobs = await this.#store.queue.fetch(this.#kind.queue, {
92
- batchSize: free,
116
+ // A fetch that fails waits for the backstop, as pg-boss's worker
117
+ // polls again after a failed fetch.
118
+ const jobs = await this.#store.queue
119
+ .fetch(this.#kind.queue, { batchSize: free })
120
+ .catch((error) => {
121
+ warn(error);
122
+ return [];
93
123
  });
94
124
  backlog = jobs.length === free;
95
125
  for (const job of jobs) {
96
126
  const run = this.#run(slots, job, () => backlog)
97
- .catch((error) => this.#failed.abort(error))
127
+ // A settle that fails leaves the job to lapse by its heartbeat,
128
+ // and the store runs it again by the kind's rules.
129
+ .catch(warn)
98
130
  .finally(() => {
99
131
  running.delete(run);
100
132
  changed.broadcast();
@@ -113,6 +145,7 @@ export class PoolWorkers {
113
145
  await Promise.all(running);
114
146
  // A standby takes over before the workers close: a close can be slow.
115
147
  await term.resign();
148
+ this.#role = STANDBY;
116
149
  await slots[Symbol.asyncDispose]();
117
150
  }
118
151
  }
@@ -209,19 +242,22 @@ export class PoolWorkers {
209
242
  });
210
243
  if (this.#clock.performance.now() >= deadline)
211
244
  return { expired: true };
212
- const { affected } = await this.#store.queue.touch(this.#kind.queue, attempt);
245
+ let affected;
246
+ try {
247
+ ({ affected } = await this.#store.queue.touch(this.#kind.queue, attempt));
248
+ }
249
+ catch (error) {
250
+ // The job keeps its worker, and the next touch tries again.
251
+ warn(error);
252
+ continue;
253
+ }
213
254
  if (affected === 0)
214
255
  return { gone: true };
215
256
  }
216
257
  }
217
258
  async [Symbol.asyncDispose]() {
218
259
  this.#disposed.abort();
219
- try {
220
- await this.#ended.wait();
221
- }
222
- finally {
223
- await this.#store[Symbol.asyncDispose]();
224
- }
260
+ await this.#ended.wait();
225
261
  }
226
262
  }
227
263
  // The pool does not check the input itself: a sender and an owner of one
@@ -235,4 +271,12 @@ function failure(error) {
235
271
  ? { name: error.name, message: error.message }
236
272
  : { name: 'Error', message: String(error) };
237
273
  }
274
+ /**
275
+ * A failure of the store that no caller waits for, as a process warning: the
276
+ * owner goes on, and the next pass, fetch or touch tries again, as pg-boss
277
+ * emits the failure of a pass and keeps polling.
278
+ */
279
+ function warn(error) {
280
+ process.emitWarning(Error.isError(error) ? error : new Error(String(error), { cause: error }));
281
+ }
238
282
  //# sourceMappingURL=pool-workers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pool-workers.js","sourceRoot":"","sources":["../src/pool-workers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAkB,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAa,MAAM,mBAAmB,CAAC;AAI9D,OAAO,EAAa,KAAK,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAInD,6EAA6E;AAC7E,MAAM,QAAQ,GAAG,KAAK,CAAC;AAiBvB;;;;;;;;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,CAAC;QACb,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,QAAQ,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC,CAAC;QAChB,KAAK,EAAE,KAAK,CAAC;QACb,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;KACpC;IAuBD,IAAI,OAAO,IAAI,WAAW,CAEzB;IAID,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAKtB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS;IAsBhC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC;IAgBT,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAmBvC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI;IAUpC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IA2B9C,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI;IAsLtB,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;CAM7C"}
package/dist/slots.js CHANGED
@@ -294,16 +294,21 @@ export class Slots {
294
294
  }
295
295
  const state = { kind: 'backoff', wait: new AbortController() };
296
296
  this.#enter(slot, state);
297
+ const ended = AbortSignal.any([state.wait.signal, this.#stopped.signal]);
297
298
  delay(backoff.duration(slot.early - 1), {
298
299
  clock: this.#clock,
299
- signal: AbortSignal.any([state.wait.signal, this.#stopped.signal]),
300
+ signal: ended,
300
301
  }).then(() => {
301
302
  if (slot.state !== state)
302
303
  return;
303
304
  this.#enter(slot, { kind: 'empty' });
304
305
  if (slot.index < this.#sizing.current)
305
306
  this.#spawn(slot);
306
- }, () => undefined);
307
+ }, (error) => {
308
+ // The rejection of the wait is the end of the back-off.
309
+ if (error !== ended.reason)
310
+ throw error;
311
+ });
307
312
  }
308
313
  // Closes the worker of a slot the pool no longer keeps, once its job ends.
309
314
  #retire(slot) {
@@ -314,7 +319,13 @@ export class Slots {
314
319
  if (state.kind === 'ready' || state.kind === 'lost')
315
320
  void this.#close(state.worker);
316
321
  else if (state.kind === 'starting')
317
- void state.outcome.wait().then((worker) => this.#close(worker), () => undefined);
322
+ // A start that fails closes its own worker, and its failure stays in
323
+ // the outcome for the job or the startup that waits for it (ADR 0010),
324
+ // so only a started worker is left to close.
325
+ void Promise.allSettled([state.outcome.wait()]).then(async ([start]) => {
326
+ if (start.status === 'fulfilled')
327
+ await this.#close(start.value);
328
+ });
318
329
  }
319
330
  async #close(worker) {
320
331
  await worker.close();
package/dist/slots.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"slots.js","sourceRoot":"","sources":["../src/slots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAc,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAQpE,yEAAyE;AACzE,yEAAyE;AACzE,6EAA6E;AAC7E,kDAAkD;AAClD,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC;IAC1B,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,CAAC;IACb,GAAG,EAAE,MAAM;IACX,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;CACzB,CAAC,CAAC;AAEH,iDAAiD;AACjD,MAAM,YAAY,GAAG,OAAO,CAAC;AA+B7B,2EAA2E;AAC3E,4EAA4E;AAC5E,6EAA6E;AAC7E,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAC5E,8EAA8E;AAC9E,MAAM,OAAO,KAAK;IAGP,OAAO,CAAU;IACjB,QAAQ,CAAU;IAClB,OAAO,CAAS;IAChB,SAAS,CAAW;IACpB,QAAQ,CAA4B;IACpC,MAAM,CAAY;IAClB,KAAK,GAAG,IAAI,GAAG,EAAW,CAAC;IAC3B,QAAQ,GAAG,IAAI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M,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zukhruf/pool",
3
- "version": "0.8.43",
3
+ "version": "0.8.44",
4
4
  "description": "Lends long-lived workers, such as native helper processes, to one job at a time: startups decide when workers start, sizings decide how many run, evictions decide when an idle worker closes, and a worker that exits is replaced.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -41,16 +41,16 @@
41
41
  "access": "public"
42
42
  },
43
43
  "dependencies": {
44
- "@zukhruf/async": "^0.8.43",
45
- "@zukhruf/election": "^0.8.43",
46
- "@zukhruf/sqlite-notify": "^0.8.43",
47
- "@zukhruf/sqlite-open": "^0.8.43",
48
- "@zukhruf/sqlite-queue": "^0.8.43",
44
+ "@zukhruf/async": "^0.8.44",
45
+ "@zukhruf/election": "^0.8.44",
46
+ "@zukhruf/sqlite-notify": "^0.8.44",
47
+ "@zukhruf/sqlite-open": "^0.8.44",
48
+ "@zukhruf/sqlite-queue": "^0.8.44",
49
49
  "p-queue": "10.0.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@sinonjs/fake-timers": "15.4.0",
53
- "@zukhruf/fs": "^0.8.43",
54
- "@zukhruf/testing": "^0.8.43"
53
+ "@zukhruf/fs": "^0.8.44",
54
+ "@zukhruf/testing": "^0.8.44"
55
55
  }
56
56
  }