@adonis-agora/durable 0.7.0 → 0.8.1
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/CHANGELOG.md +81 -0
- package/README.md +1 -1
- package/dist/commands/main.d.ts +3 -2
- package/dist/commands/main.d.ts.map +1 -1
- package/dist/commands/main.js +3 -2
- package/dist/commands/main.js.map +1 -1
- package/dist/commands/make_workflow.d.ts +4 -3
- package/dist/commands/make_workflow.d.ts.map +1 -1
- package/dist/commands/make_workflow.js +4 -3
- package/dist/commands/make_workflow.js.map +1 -1
- package/dist/configure.d.ts +6 -5
- package/dist/configure.d.ts.map +1 -1
- package/dist/configure.js +9 -6
- package/dist/configure.js.map +1 -1
- package/dist/providers/dashboard_provider.d.ts +34 -3
- package/dist/providers/dashboard_provider.d.ts.map +1 -1
- package/dist/providers/dashboard_provider.js +130 -9
- package/dist/providers/dashboard_provider.js.map +1 -1
- package/dist/src/base-workflow.d.ts +78 -0
- package/dist/src/base-workflow.d.ts.map +1 -0
- package/dist/src/base-workflow.js +106 -0
- package/dist/src/base-workflow.js.map +1 -0
- package/dist/src/codec-state-store.d.ts +13 -0
- package/dist/src/codec-state-store.d.ts.map +1 -1
- package/dist/src/codec-state-store.js +13 -0
- package/dist/src/codec-state-store.js.map +1 -1
- package/dist/src/control-flow-signal.d.ts +50 -0
- package/dist/src/control-flow-signal.d.ts.map +1 -0
- package/dist/src/control-flow-signal.js +54 -0
- package/dist/src/control-flow-signal.js.map +1 -0
- package/dist/src/control-plane-redis/redis-control-plane.d.ts +57 -5
- package/dist/src/control-plane-redis/redis-control-plane.d.ts.map +1 -1
- package/dist/src/control-plane-redis/redis-control-plane.js +100 -2
- package/dist/src/control-plane-redis/redis-control-plane.js.map +1 -1
- package/dist/src/dashboard/auth.d.ts +89 -0
- package/dist/src/dashboard/auth.d.ts.map +1 -0
- package/dist/src/dashboard/auth.js +113 -0
- package/dist/src/dashboard/auth.js.map +1 -0
- package/dist/src/dashboard/define_config.d.ts +17 -0
- package/dist/src/dashboard/define_config.d.ts.map +1 -1
- package/dist/src/dashboard/define_config.js +23 -1
- package/dist/src/dashboard/define_config.js.map +1 -1
- package/dist/src/dashboard/index.d.ts +5 -0
- package/dist/src/dashboard/index.d.ts.map +1 -1
- package/dist/src/dashboard/index.js +4 -0
- package/dist/src/dashboard/index.js.map +1 -1
- package/dist/src/dashboard/login_page.d.ts +23 -0
- package/dist/src/dashboard/login_page.d.ts.map +1 -0
- package/dist/src/dashboard/login_page.js +170 -0
- package/dist/src/dashboard/login_page.js.map +1 -0
- package/dist/src/dashboard/session_cookie.d.ts +42 -0
- package/dist/src/dashboard/session_cookie.d.ts.map +1 -0
- package/dist/src/dashboard/session_cookie.js +97 -0
- package/dist/src/dashboard/session_cookie.js.map +1 -0
- package/dist/src/define_config.d.ts +3 -2
- package/dist/src/define_config.d.ts.map +1 -1
- package/dist/src/define_config.js.map +1 -1
- package/dist/src/engine.d.ts +51 -1
- package/dist/src/engine.d.ts.map +1 -1
- package/dist/src/engine.js +213 -27
- package/dist/src/engine.js.map +1 -1
- package/dist/src/errors.d.ts +6 -1
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +7 -2
- package/dist/src/errors.js.map +1 -1
- package/dist/src/event-accumulators.d.ts +1 -1
- package/dist/src/event-accumulators.d.ts.map +1 -1
- package/dist/src/events.d.ts +16 -0
- package/dist/src/events.d.ts.map +1 -1
- package/dist/src/events.js +26 -1
- package/dist/src/events.js.map +1 -1
- package/dist/src/hooks/workflows.d.ts +3 -2
- package/dist/src/hooks/workflows.d.ts.map +1 -1
- package/dist/src/hooks/workflows.js +3 -2
- package/dist/src/hooks/workflows.js.map +1 -1
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/interfaces.d.ts +44 -1
- package/dist/src/interfaces.d.ts.map +1 -1
- package/dist/src/services/main.d.ts +13 -0
- package/dist/src/services/main.d.ts.map +1 -0
- package/dist/src/services/main.js +17 -0
- package/dist/src/services/main.js.map +1 -0
- package/dist/src/step-name-symbol.d.ts +2 -2
- package/dist/src/step-name-symbol.js +2 -2
- package/dist/src/stores/lucid-schema.d.ts +1 -0
- package/dist/src/stores/lucid-schema.d.ts.map +1 -1
- package/dist/src/stores/lucid-schema.js +15 -0
- package/dist/src/stores/lucid-schema.js.map +1 -1
- package/dist/src/stores/lucid.d.ts +13 -0
- package/dist/src/stores/lucid.d.ts.map +1 -1
- package/dist/src/stores/lucid.js +43 -0
- package/dist/src/stores/lucid.js.map +1 -1
- package/dist/src/testing/in-memory-state-store.d.ts +16 -0
- package/dist/src/testing/in-memory-state-store.d.ts.map +1 -1
- package/dist/src/testing/in-memory-state-store.js +29 -0
- package/dist/src/testing/in-memory-state-store.js.map +1 -1
- package/dist/src/testing-kit/state-store-conformance.d.ts.map +1 -1
- package/dist/src/testing-kit/state-store-conformance.js +31 -0
- package/dist/src/testing-kit/state-store-conformance.js.map +1 -1
- package/dist/src/workflow-als.d.ts +21 -0
- package/dist/src/workflow-als.d.ts.map +1 -0
- package/dist/src/workflow-als.js +22 -0
- package/dist/src/workflow-als.js.map +1 -0
- package/dist/src/workflow-ctx.d.ts.map +1 -1
- package/dist/src/workflow-ctx.js +83 -4
- package/dist/src/workflow-ctx.js.map +1 -1
- package/dist/src/workflow-discovery.d.ts +21 -15
- package/dist/src/workflow-discovery.d.ts.map +1 -1
- package/dist/src/workflow-discovery.js +17 -13
- package/dist/src/workflow-discovery.js.map +1 -1
- package/dist/src/workflow-ref.d.ts +9 -27
- package/dist/src/workflow-ref.d.ts.map +1 -1
- package/dist/src/workflow-ref.js +12 -34
- package/dist/src/workflow-ref.js.map +1 -1
- package/dist/stubs/database/migrations/create_durable_tables.stub +13 -1
- package/dist/stubs/make/workflow/main.stub +4 -3
- package/package.json +6 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { WorkflowEngine } from './engine.js';
|
|
2
|
+
import { getCurrentWorkflowCtx } from './workflow-als.js';
|
|
3
|
+
let engineResolver;
|
|
4
|
+
/**
|
|
5
|
+
* Override how `BaseWorkflow.start`/`dispatch` resolve the engine when called OUTSIDE a running
|
|
6
|
+
* workflow. Pass a resolver returning the engine to use; pass `undefined` to restore the default
|
|
7
|
+
* (container lookup). Primarily a testing seam — inject an in-memory engine, then reset in teardown.
|
|
8
|
+
*/
|
|
9
|
+
export function setWorkflowEngineResolver(resolver) {
|
|
10
|
+
engineResolver = resolver;
|
|
11
|
+
}
|
|
12
|
+
/** Resolve the engine for the OUTSIDE path: the injected resolver if set, else the app container. */
|
|
13
|
+
async function resolveEngine() {
|
|
14
|
+
if (engineResolver)
|
|
15
|
+
return engineResolver();
|
|
16
|
+
// Lazy import so the module-singleton `app` locator is only touched on the outside path, and so
|
|
17
|
+
// importing `BaseWorkflow` never eagerly pulls in `@adonisjs/core` (mirrors queue `Job.dispatch`).
|
|
18
|
+
const app = (await import('@adonisjs/core/services/app')).default;
|
|
19
|
+
return app.container.make(WorkflowEngine);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Base class for a durable workflow. Declare the workflow's identity as a
|
|
23
|
+
* `static workflow = { name, version }` config and implement `run(ctx, input)`:
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* export default class CheckoutWorkflow extends BaseWorkflow {
|
|
27
|
+
* static workflow = { name: 'checkout', version: '1' }
|
|
28
|
+
* async run(ctx: WorkflowCtx, order: Order) { … }
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* The static `workflow` config is resolved through `workflowName()` and registered via
|
|
33
|
+
* `app/workflows` auto-discovery.
|
|
34
|
+
*
|
|
35
|
+
* ## Context-aware dispatch
|
|
36
|
+
* The statics behave differently depending on whether they're called inside or outside a running
|
|
37
|
+
* workflow body (detected via the ambient ctx — see {@link getCurrentWorkflowCtx}):
|
|
38
|
+
*
|
|
39
|
+
* | | OUTSIDE (controller/service/script) | INSIDE a running workflow body |
|
|
40
|
+
* |------------|----------------------------------------------------------|---------------------------------------|
|
|
41
|
+
* | `.start` | `engine.start` + `waitForRun` → blocks, returns result | `ctx.child` → linked child, awaits it |
|
|
42
|
+
* | `.dispatch`| `engine.start` → fire-and-forget, returns `{ runId }` | `ctx.startChild` → fire-and-forget |
|
|
43
|
+
*
|
|
44
|
+
* `.start` always means "I want the result"; `.dispatch` always means "fire and forget" — in both
|
|
45
|
+
* contexts. Inside a workflow, routing through `ctx.child`/`ctx.startChild` (never the engine) is what
|
|
46
|
+
* keeps the run deterministic and replay-safe.
|
|
47
|
+
*/
|
|
48
|
+
export class BaseWorkflow {
|
|
49
|
+
/**
|
|
50
|
+
* The workflow's identity + options. Read by `workflowMeta()`/`workflowName()` and by
|
|
51
|
+
* `app/workflows` auto-discovery. Omit it and the class is not a registrable workflow.
|
|
52
|
+
*/
|
|
53
|
+
static workflow;
|
|
54
|
+
/**
|
|
55
|
+
* Start a run and **wait for its result**. Outside a workflow, enqueues via the engine and blocks
|
|
56
|
+
* until the run settles, returning its output. Inside a running workflow, starts a **linked child**
|
|
57
|
+
* (`ctx.child`) — the parent suspends until the child settles — and returns the child's output.
|
|
58
|
+
*/
|
|
59
|
+
static start(input, opts) {
|
|
60
|
+
const ctx = getCurrentWorkflowCtx();
|
|
61
|
+
if (ctx) {
|
|
62
|
+
// INSIDE: linked child. Pass opts?.runId as the childId; when absent, ctx.child derives a
|
|
63
|
+
// deterministic, replay-stable id from call position — never generate one here.
|
|
64
|
+
// biome-ignore lint/complexity/noThisInStatic: `this` is the polymorphic subclass, declared as `this: C` above — it is the dispatch mechanism. Naming the class here would always start BaseWorkflow instead of the caller's workflow.
|
|
65
|
+
return ctx.child(this, input, opts?.runId);
|
|
66
|
+
}
|
|
67
|
+
// OUTSIDE: enqueue on the engine, then block until the run reaches a TERMINAL state. `runId` is a
|
|
68
|
+
// BaseWorkflow-only option (not part of StartOptions) — strip it before forwarding to engine.start.
|
|
69
|
+
return (async () => {
|
|
70
|
+
const engine = await resolveEngine();
|
|
71
|
+
const { runId: _runId, ...startOpts } = opts ?? {};
|
|
72
|
+
const runId = opts?.runId ?? globalThis.crypto.randomUUID();
|
|
73
|
+
// biome-ignore lint/complexity/noThisInStatic: see .start's child branch — `this` is the polymorphic subclass (`this: C`), not BaseWorkflow.
|
|
74
|
+
await engine.start(this, input, runId, startOpts);
|
|
75
|
+
// `terminal: true` so a workflow that suspends (sleep/waitForSignal/waitForEvent/async step)
|
|
76
|
+
// keeps blocking through the suspension and returns the real output — the ".start = I want the
|
|
77
|
+
// result" contract, matching the INSIDE ctx.child path (which also waits for terminal).
|
|
78
|
+
const result = await engine.waitForRun(runId, { terminal: true });
|
|
79
|
+
return result.output;
|
|
80
|
+
})();
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Start a run **fire-and-forget** and return its `{ runId }` without waiting. Outside a workflow,
|
|
84
|
+
* enqueues via the engine and returns immediately. Inside a running workflow, kicks off a
|
|
85
|
+
* fire-and-forget child (`ctx.startChild`) — the parent keeps running — and returns the child id.
|
|
86
|
+
*/
|
|
87
|
+
static dispatch(input, opts) {
|
|
88
|
+
const ctx = getCurrentWorkflowCtx();
|
|
89
|
+
if (ctx) {
|
|
90
|
+
// INSIDE: fire-and-forget child. Same childId rule as .start — let ctx derive it when absent.
|
|
91
|
+
// biome-ignore lint/complexity/noThisInStatic: see .start — `this` is the polymorphic subclass (`this: C`), not BaseWorkflow.
|
|
92
|
+
return ctx.startChild(this, input, opts?.runId).then((runId) => ({ runId }));
|
|
93
|
+
}
|
|
94
|
+
// OUTSIDE: enqueue and return the id without blocking on the settle. `runId` is a BaseWorkflow-only
|
|
95
|
+
// option (not part of StartOptions) — strip it before forwarding to engine.start.
|
|
96
|
+
return (async () => {
|
|
97
|
+
const engine = await resolveEngine();
|
|
98
|
+
const { runId: _runId, ...startOpts } = opts ?? {};
|
|
99
|
+
const runId = opts?.runId ?? globalThis.crypto.randomUUID();
|
|
100
|
+
// biome-ignore lint/complexity/noThisInStatic: see .start — `this` is the polymorphic subclass (`this: C`), not BaseWorkflow.
|
|
101
|
+
await engine.start(this, input, runId, startOpts);
|
|
102
|
+
return { runId };
|
|
103
|
+
})();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=base-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-workflow.js","sourceRoot":"","sources":["../../src/base-workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAyB1D,IAAI,cAAkD,CAAC;AAEvD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,QAA4C;IACpF,cAAc,GAAG,QAAQ,CAAC;AAC5B,CAAC;AAED,qGAAqG;AACrG,KAAK,UAAU,aAAa;IAC1B,IAAI,cAAc;QAAE,OAAO,cAAc,EAAE,CAAC;IAC5C,gGAAgG;IAChG,mGAAmG;IACnG,MAAM,GAAG,GAAG,CAAC,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC,CAAC,OAAO,CAAC;IAClE,OAAO,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,OAAgB,YAAY;IAChC;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAmB;IAKlC;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAEV,KAAyB,EACzB,IAA8B;QAE9B,MAAM,GAAG,GAAG,qBAAqB,EAAE,CAAC;QACpC,IAAI,GAAG,EAAE,CAAC;YACR,0FAA0F;YAC1F,gFAAgF;YAChF,uOAAuO;YACvO,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAiC,CAAC;QAC7E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EAAE,KAAK,IAAI,UAAU,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;YAC5D,8HAA8H;YAC9H,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;YAClD,OAAO,EAAE,KAAK,EAAE,CAAC;QACnB,CAAC,CAAC,EAAE,CAAC;IACP,CAAC;CACF"}
|
|
@@ -48,10 +48,23 @@ export declare class CodecStateStore implements StateStore {
|
|
|
48
48
|
putSignalWaiter(waiter: SignalWaiter): Promise<void>;
|
|
49
49
|
takeSignalWaiter(token: string): Promise<SignalWaiter | null>;
|
|
50
50
|
listSignalWaiters(prefix: string): Promise<SignalWaiter[]>;
|
|
51
|
+
removeSignalWaiter(waiter: SignalWaiter): Promise<void>;
|
|
51
52
|
bufferSignal(token: string, payload: unknown): Promise<void>;
|
|
52
53
|
takeBufferedSignal(token: string): Promise<{
|
|
53
54
|
payload: unknown;
|
|
54
55
|
} | null>;
|
|
56
|
+
bufferEvent(input: {
|
|
57
|
+
name: string;
|
|
58
|
+
payload: unknown;
|
|
59
|
+
id: string;
|
|
60
|
+
publishedAt: number;
|
|
61
|
+
}): Promise<void>;
|
|
62
|
+
listBufferedEvents(name: string, limit: number): Promise<Array<{
|
|
63
|
+
id: string;
|
|
64
|
+
payload: unknown;
|
|
65
|
+
publishedAt: number;
|
|
66
|
+
}>>;
|
|
67
|
+
removeBufferedEvent(id: string): Promise<boolean>;
|
|
55
68
|
listRuns(query: RunQuery): Promise<WorkflowRun[]>;
|
|
56
69
|
listCheckpoints(runId: string): Promise<StepCheckpoint[]>;
|
|
57
70
|
getLatestCheckpointByName(runId: string, name: string): Promise<StepCheckpoint | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec-state-store.d.ts","sourceRoot":"","sources":["../../src/codec-state-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,cA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O,EAAE,OAAO,CAAC;QACjB,EAAE,EAAE,MAAM,CAAC;QACX,WAAW,EAAE,MAAM,CAAC;KACrB,GAAG,OAAO,CAAC,IAAI,CAAC;IAGX,kBAAkB,CACtB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAIxE,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAG3C,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAGjD,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAGzD,yBAAyB,CAC7B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAWhC,2BAA2B,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;CAQhG"}
|
|
@@ -93,6 +93,9 @@ export class CodecStateStore {
|
|
|
93
93
|
listSignalWaiters(prefix) {
|
|
94
94
|
return this.inner.listSignalWaiters(prefix);
|
|
95
95
|
}
|
|
96
|
+
removeSignalWaiter(waiter) {
|
|
97
|
+
return this.inner.removeSignalWaiter(waiter);
|
|
98
|
+
}
|
|
96
99
|
bufferSignal(token, payload) {
|
|
97
100
|
return this.inner.bufferSignal(token, this.enc(payload));
|
|
98
101
|
}
|
|
@@ -100,6 +103,16 @@ export class CodecStateStore {
|
|
|
100
103
|
const buffered = await this.inner.takeBufferedSignal(token);
|
|
101
104
|
return buffered && { payload: this.dec(buffered.payload) };
|
|
102
105
|
}
|
|
106
|
+
bufferEvent(input) {
|
|
107
|
+
return this.inner.bufferEvent({ ...input, payload: this.enc(input.payload) });
|
|
108
|
+
}
|
|
109
|
+
async listBufferedEvents(name, limit) {
|
|
110
|
+
const events = await this.inner.listBufferedEvents(name, limit);
|
|
111
|
+
return events.map((e) => ({ ...e, payload: this.dec(e.payload) }));
|
|
112
|
+
}
|
|
113
|
+
removeBufferedEvent(id) {
|
|
114
|
+
return this.inner.removeBufferedEvent(id);
|
|
115
|
+
}
|
|
103
116
|
async listRuns(query) {
|
|
104
117
|
return (await this.inner.listRuns(query)).map((r) => this.decRun(r));
|
|
105
118
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec-state-store.js","sourceRoot":"","sources":["../../src/codec-state-store.ts"],"names":[],"mappings":"AAkBA;;;;;;;;;GASG;AACH,MAAM,OAAO,eAAe;IAEP;IACA;IAFnB,YACmB,KAAiB,EACjB,KAAmB;QADnB,UAAK,GAAL,KAAK,CAAY;QACjB,UAAK,GAAL,KAAK,CAAc;IACnC,CAAC;IAEI,GAAG,CAAC,CAAU;QACpB,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;IACO,GAAG,CAAC,CAAU;QACpB,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;IAEO,MAAM,CAAC,GAAgB;QAC7B,OAAO,EAAE,GAAG,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;IAC9E,CAAC;IACO,MAAM,CAA+B,GAAM;QACjD,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,GAAG,EAAE,KAAK,EA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C,SAAS,CAAC;QACzC,CAAC;QACD,IAAI,MAAkC,CAAC;QACvC,KAAK,MAAM,EAAE,IAAI,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC;YAAE,IAAI,EAAE,CAAC,IAAI,KAAK,IAAI;gBAAE,MAAM,GAAG,EAAE,CAAC;QAC5F,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACjD,CAAC;IACD,KAAK,CAAC,2BAA2B,CAAC,KAAa,EAAE,QAAkB;QACjE,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,2BAA2B;YACpD,CAAC,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,2BAA2B,CAAC,KAAK,EAAE,QAAQ,CAAC;YAC/D,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CACtD,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAC5C,CAAC;QACN,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC;CACF"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-package, cross-runtime marker for engine CONTROL-FLOW signals — {@link WorkflowSuspended}
|
|
3
|
+
* and {@link ContinueAsNew} (see `./errors.ts`). These are thrown by `WorkflowCtx` ops to unwind the
|
|
4
|
+
* current turn — never real failures — so a workflow's `catch` block MUST rethrow them untouched.
|
|
5
|
+
* Running a failure/cleanup path on a control-flow signal corrupts the run: it emits extra
|
|
6
|
+
* `recordStep` commands into history that a subsequent replay didn't produce the first time,
|
|
7
|
+
* surfacing as a `NonDeterminismError` on resume.
|
|
8
|
+
*
|
|
9
|
+
* `Symbol.for` (the GLOBAL registry), NOT a plain `Symbol()` — so a duplicate copy of this module
|
|
10
|
+
* (pnpm peer-dependency multiplexing, or a dual ESM/CJS load) still collapses onto the SAME symbol.
|
|
11
|
+
* Same rationale as `DURABLE_STEP_NAME` in `./step-name-symbol.ts`; uses the `@agora/` wire namespace
|
|
12
|
+
* matching the other cross-package symbols in this package.
|
|
13
|
+
*
|
|
14
|
+
* Deliberately checked as a stamped property, NOT `instanceof` — `instanceof` only recognizes a
|
|
15
|
+
* signal thrown by the SAME class the checking code imported, which fails across a duplicate module
|
|
16
|
+
* copy (two different `WorkflowSuspended`/`ContinueAsNew` classes for what is, from a workflow
|
|
17
|
+
* author's catch block, the same "this isn't a real error, let it through" event).
|
|
18
|
+
*
|
|
19
|
+
* NOT designed to survive a serialization boundary (e.g. JSON over the wire) — these signals are
|
|
20
|
+
* always thrown and caught in-process within a single replay turn, never (de)serialized, so a
|
|
21
|
+
* stamped-but-not-cloneable property is sufficient.
|
|
22
|
+
*/
|
|
23
|
+
export declare const CONTROL_FLOW_SIGNAL: unique symbol;
|
|
24
|
+
/**
|
|
25
|
+
* True for any engine control-flow signal (currently: {@link WorkflowSuspended} and
|
|
26
|
+
* {@link ContinueAsNew}) — regardless of which module instance threw it. Workflow `catch` blocks
|
|
27
|
+
* MUST rethrow these untouched; running a failure/cleanup path on one corrupts the run's history
|
|
28
|
+
* (extra commands recorded during what replay will later see as a suspend, not a failure) and the
|
|
29
|
+
* resumed replay dies with a non-determinism error.
|
|
30
|
+
*
|
|
31
|
+
* Deliberately NOT control-flow (do not add to this predicate):
|
|
32
|
+
* - a cancelled run — a TERMINAL outcome the consumer may legitimately want to observe and react to
|
|
33
|
+
* (e.g. release a lock), not a mid-turn unwind to rethrow untouched.
|
|
34
|
+
* - a `FatalError` / an awaited step rejection reaching the engine — a REAL failure a workflow's
|
|
35
|
+
* `catch` is meant to compensate for; misclassifying it as control-flow would swallow genuine
|
|
36
|
+
* errors instead of protecting them.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* try {
|
|
41
|
+
* await ctx.step('chargeCard', input);
|
|
42
|
+
* } catch (error) {
|
|
43
|
+
* if (isWorkflowControlFlowSignal(error)) throw error; // suspend/continue-as-new: rethrow as-is
|
|
44
|
+
* await ctx.step('refund', input); // a REAL failure — safe to run cleanup here
|
|
45
|
+
* throw error;
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function isWorkflowControlFlowSignal(error: unknown): boolean;
|
|
50
|
+
//# sourceMappingURL=control-flow-signal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-flow-signal.d.ts","sourceRoot":"","sources":["../../src/control-flow-signal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,mBAAmB,EAAE,OAAO,MAAkD,CAAC;AAE5F;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAMnE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-package, cross-runtime marker for engine CONTROL-FLOW signals — {@link WorkflowSuspended}
|
|
3
|
+
* and {@link ContinueAsNew} (see `./errors.ts`). These are thrown by `WorkflowCtx` ops to unwind the
|
|
4
|
+
* current turn — never real failures — so a workflow's `catch` block MUST rethrow them untouched.
|
|
5
|
+
* Running a failure/cleanup path on a control-flow signal corrupts the run: it emits extra
|
|
6
|
+
* `recordStep` commands into history that a subsequent replay didn't produce the first time,
|
|
7
|
+
* surfacing as a `NonDeterminismError` on resume.
|
|
8
|
+
*
|
|
9
|
+
* `Symbol.for` (the GLOBAL registry), NOT a plain `Symbol()` — so a duplicate copy of this module
|
|
10
|
+
* (pnpm peer-dependency multiplexing, or a dual ESM/CJS load) still collapses onto the SAME symbol.
|
|
11
|
+
* Same rationale as `DURABLE_STEP_NAME` in `./step-name-symbol.ts`; uses the `@agora/` wire namespace
|
|
12
|
+
* matching the other cross-package symbols in this package.
|
|
13
|
+
*
|
|
14
|
+
* Deliberately checked as a stamped property, NOT `instanceof` — `instanceof` only recognizes a
|
|
15
|
+
* signal thrown by the SAME class the checking code imported, which fails across a duplicate module
|
|
16
|
+
* copy (two different `WorkflowSuspended`/`ContinueAsNew` classes for what is, from a workflow
|
|
17
|
+
* author's catch block, the same "this isn't a real error, let it through" event).
|
|
18
|
+
*
|
|
19
|
+
* NOT designed to survive a serialization boundary (e.g. JSON over the wire) — these signals are
|
|
20
|
+
* always thrown and caught in-process within a single replay turn, never (de)serialized, so a
|
|
21
|
+
* stamped-but-not-cloneable property is sufficient.
|
|
22
|
+
*/
|
|
23
|
+
export const CONTROL_FLOW_SIGNAL = Symbol.for('@agora/durable:control-flow');
|
|
24
|
+
/**
|
|
25
|
+
* True for any engine control-flow signal (currently: {@link WorkflowSuspended} and
|
|
26
|
+
* {@link ContinueAsNew}) — regardless of which module instance threw it. Workflow `catch` blocks
|
|
27
|
+
* MUST rethrow these untouched; running a failure/cleanup path on one corrupts the run's history
|
|
28
|
+
* (extra commands recorded during what replay will later see as a suspend, not a failure) and the
|
|
29
|
+
* resumed replay dies with a non-determinism error.
|
|
30
|
+
*
|
|
31
|
+
* Deliberately NOT control-flow (do not add to this predicate):
|
|
32
|
+
* - a cancelled run — a TERMINAL outcome the consumer may legitimately want to observe and react to
|
|
33
|
+
* (e.g. release a lock), not a mid-turn unwind to rethrow untouched.
|
|
34
|
+
* - a `FatalError` / an awaited step rejection reaching the engine — a REAL failure a workflow's
|
|
35
|
+
* `catch` is meant to compensate for; misclassifying it as control-flow would swallow genuine
|
|
36
|
+
* errors instead of protecting them.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* try {
|
|
41
|
+
* await ctx.step('chargeCard', input);
|
|
42
|
+
* } catch (error) {
|
|
43
|
+
* if (isWorkflowControlFlowSignal(error)) throw error; // suspend/continue-as-new: rethrow as-is
|
|
44
|
+
* await ctx.step('refund', input); // a REAL failure — safe to run cleanup here
|
|
45
|
+
* throw error;
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export function isWorkflowControlFlowSignal(error) {
|
|
50
|
+
return (typeof error === 'object' &&
|
|
51
|
+
error !== null &&
|
|
52
|
+
error[CONTROL_FLOW_SIGNAL] === true);
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=control-flow-signal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-flow-signal.js","sourceRoot":"","sources":["../../src/control-flow-signal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAkB,MAAM,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;AAE5F;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,2BAA2B,CAAC,KAAc;IACxD,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACb,KAA6C,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAC7E,CAAC;AACJ,CAAC"}
|
|
@@ -21,12 +21,22 @@ export interface RedisPubSub {
|
|
|
21
21
|
* the `@adonisjs/redis` connection takes a channel + a per-message handler.
|
|
22
22
|
*/
|
|
23
23
|
subscribe(channel: string, handler?: (message: string, channel: string) => void): unknown;
|
|
24
|
-
/**
|
|
25
|
-
|
|
24
|
+
/**
|
|
25
|
+
* ioredis-only: connection events. `message` delivers a payload on a duplicated subscriber;
|
|
26
|
+
* `error`/`ready`/`subscribe` are used by the watchdog (see {@link RedisControlPlaneOptions.pingIntervalMs}).
|
|
27
|
+
*/
|
|
28
|
+
on?(event: string, listener: (...args: never[]) => void): unknown;
|
|
26
29
|
/** ioredis-only: build a dedicated subscriber connection (pub/sub can't share a command client). */
|
|
27
30
|
duplicate?(): RedisPubSub;
|
|
28
|
-
/**
|
|
29
|
-
|
|
31
|
+
/**
|
|
32
|
+
* ioredis-only: tear down the duplicated subscriber connection. `disconnect(true)` reconnects
|
|
33
|
+
* (ioredis's `retryStrategy` + `autoResubscribe`) rather than closing for good.
|
|
34
|
+
*/
|
|
35
|
+
disconnect?(reconnect?: boolean): void;
|
|
36
|
+
/** ioredis-only: liveness probe. Legal in subscriber mode (ioredis's `VALID_IN_SUBSCRIBER_MODE`). */
|
|
37
|
+
ping?(): Promise<unknown>;
|
|
38
|
+
/** ioredis-only: connection state — the watchdog skips anything that isn't `'ready'`. */
|
|
39
|
+
status?: string;
|
|
30
40
|
}
|
|
31
41
|
export interface RedisControlPlaneOptions {
|
|
32
42
|
/** An ioredis instance or an `@adonisjs/redis` connection used for pub/sub. */
|
|
@@ -37,6 +47,22 @@ export interface RedisControlPlaneOptions {
|
|
|
37
47
|
* and a NestJS fleet sharing one Redis interoperate on the same control plane.
|
|
38
48
|
*/
|
|
39
49
|
prefix?: string;
|
|
50
|
+
/**
|
|
51
|
+
* How often (ms) to PING the duplicated pub/sub subscriber connection to detect — and recover
|
|
52
|
+
* from — a silent connection loss. A subscriber connection never WRITEs on its own (it only
|
|
53
|
+
* receives PUBLISHed messages), so when a VPN/NAT/idle-timeout drops the underlying TCP
|
|
54
|
+
* connection, ioredis has nothing that would surface the loss: no write ever fails, no timeout
|
|
55
|
+
* ever fires, and the connection sits "subscribed" forever while the server's `PUBSUB NUMSUB`
|
|
56
|
+
* already shows 0 — cross-pod cancels and lifecycle events silently stop arriving until the
|
|
57
|
+
* process restarts. A PING rejection or timeout means the connection is dead, so we
|
|
58
|
+
* `disconnect(true)` it: ioredis's `retryStrategy` reconnects and `autoResubscribe` (default
|
|
59
|
+
* `true`) restores the channel automatically.
|
|
60
|
+
*
|
|
61
|
+
* Pass `0` or `false` to disable (e.g. a short-lived test where the interval would outlive it).
|
|
62
|
+
* Defaults to `30_000`. Only applies to the raw-ioredis path — an `@adonisjs/redis` connection
|
|
63
|
+
* manages its own subscriber connection and its own health.
|
|
64
|
+
*/
|
|
65
|
+
pingIntervalMs?: number | false;
|
|
40
66
|
}
|
|
41
67
|
/**
|
|
42
68
|
* A {@link ControlPlane} backed by Redis pub/sub: the cross-pod broadcast channel for workflow
|
|
@@ -55,10 +81,36 @@ export declare class RedisControlPlane implements ControlPlane {
|
|
|
55
81
|
private readonly channel;
|
|
56
82
|
private subscriber;
|
|
57
83
|
private subscribed;
|
|
84
|
+
private readonly pingIntervalMs;
|
|
85
|
+
private pingWatchdogTimer;
|
|
86
|
+
private closed;
|
|
58
87
|
constructor(options: RedisControlPlaneOptions);
|
|
59
88
|
publishControl(msg: ControlMessage): Promise<void>;
|
|
60
89
|
onControl(handler: (msg: ControlMessage) => void): void;
|
|
61
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Attach a de-duplicated `error` listener to the duplicated subscriber and start the ping
|
|
92
|
+
* watchdog. The `error` listener is not optional hygiene: an unhandled `error` event on an
|
|
93
|
+
* ioredis instance crashes the process in some setups, and a dead/reconnecting subscriber emits
|
|
94
|
+
* them in bursts — so this connection, which nothing else listens to, would take the app down.
|
|
95
|
+
*/
|
|
96
|
+
private trackSubscriber;
|
|
97
|
+
/**
|
|
98
|
+
* Start the watchdog interval, unless it's disabled or already running (idempotent). Unref'd so
|
|
99
|
+
* it never keeps the process alive on its own; cleared in {@link close}.
|
|
100
|
+
*/
|
|
101
|
+
private startPingWatchdog;
|
|
102
|
+
/**
|
|
103
|
+
* PING the subscriber; on rejection or timeout, `disconnect(true)` so ioredis's `retryStrategy`
|
|
104
|
+
* reconnects and `autoResubscribe` restores the channel. Skips a connection that isn't `'ready'`
|
|
105
|
+
* — it's already mid-(re)connect, so a fresh ping would just race that cycle.
|
|
106
|
+
*
|
|
107
|
+
* The timeout is capped at `pingIntervalMs` itself (never above `SUBSCRIBER_PING_TIMEOUT_MS`):
|
|
108
|
+
* waiting longer than the gap between checks to declare one dead would just mean two checks race
|
|
109
|
+
* each other, and it lets a short interval shrink the whole detect → reconnect cycle instead of
|
|
110
|
+
* always eating the full multi-second default.
|
|
111
|
+
*/
|
|
112
|
+
private pingSubscriber;
|
|
113
|
+
/** Stop the watchdog and tear down the dedicated subscriber connection (ioredis path). */
|
|
62
114
|
close(): Promise<void>;
|
|
63
115
|
}
|
|
64
116
|
//# sourceMappingURL=redis-control-plane.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis-control-plane.d.ts","sourceRoot":"","sources":["../../../src/control-plane-redis/redis-control-plane.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhE;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,WAAW;IAC1B,+EAA+E;IAC/E,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IACnD;;;OAGG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC;IAC1F
|
|
1
|
+
{"version":3,"file":"redis-control-plane.d.ts","sourceRoot":"","sources":["../../../src/control-plane-redis/redis-control-plane.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhE;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,WAAW;IAC1B,+EAA+E;IAC/E,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IACnD;;;OAGG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,EA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AAiB;IASzB;;;;;;;;;OASG;YACW,cAAc;IAgC5B,0FAA0F;IACpF,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAO7B"}
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/** Default {@link RedisControlPlaneOptions.pingIntervalMs}. */
|
|
2
|
+
const DEFAULT_PING_INTERVAL_MS = 30_000;
|
|
3
|
+
/** How long a single watchdog PING may take before its subscriber is presumed dead. */
|
|
4
|
+
const SUBSCRIBER_PING_TIMEOUT_MS = 5_000;
|
|
5
|
+
/**
|
|
6
|
+
* Normalise `pingIntervalMs`: `undefined` → the default, `0`/`false` → disabled, any other number
|
|
7
|
+
* → itself verbatim (including a caller's smaller interval for short-lived tests).
|
|
8
|
+
*/
|
|
9
|
+
function normalizePingInterval(value) {
|
|
10
|
+
if (value === undefined)
|
|
11
|
+
return DEFAULT_PING_INTERVAL_MS;
|
|
12
|
+
if (value === false || value === 0)
|
|
13
|
+
return false;
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
1
16
|
/**
|
|
2
17
|
* A {@link ControlPlane} backed by Redis pub/sub: the cross-pod broadcast channel for workflow
|
|
3
18
|
* **lifecycle events** (so a dashboard-only pod can live-tail a run executing on a worker pod) and
|
|
@@ -15,9 +30,13 @@ export class RedisControlPlane {
|
|
|
15
30
|
channel;
|
|
16
31
|
subscriber;
|
|
17
32
|
subscribed = false;
|
|
33
|
+
pingIntervalMs;
|
|
34
|
+
pingWatchdogTimer;
|
|
35
|
+
closed = false;
|
|
18
36
|
constructor(options) {
|
|
19
37
|
this.connection = options.connection;
|
|
20
38
|
this.channel = `${options.prefix ?? 'durable'}-control`;
|
|
39
|
+
this.pingIntervalMs = normalizePingInterval(options.pingIntervalMs);
|
|
21
40
|
}
|
|
22
41
|
async publishControl(msg) {
|
|
23
42
|
await this.connection.publish(this.channel, JSON.stringify(msg));
|
|
@@ -41,15 +60,94 @@ export class RedisControlPlane {
|
|
|
41
60
|
const sub = this.connection.duplicate();
|
|
42
61
|
this.subscriber = sub;
|
|
43
62
|
void sub.subscribe(this.channel);
|
|
44
|
-
sub.on?.('message', (_channel, payload) => deliver(payload));
|
|
63
|
+
sub.on?.('message', ((_channel, payload) => deliver(payload)));
|
|
64
|
+
this.trackSubscriber(sub);
|
|
45
65
|
}
|
|
46
66
|
else {
|
|
47
67
|
// `@adonisjs/redis` connection: manages its own subscriber connection; handler gets the message.
|
|
48
68
|
void this.connection.subscribe(this.channel, (payload) => deliver(payload));
|
|
49
69
|
}
|
|
50
70
|
}
|
|
51
|
-
/**
|
|
71
|
+
/**
|
|
72
|
+
* Attach a de-duplicated `error` listener to the duplicated subscriber and start the ping
|
|
73
|
+
* watchdog. The `error` listener is not optional hygiene: an unhandled `error` event on an
|
|
74
|
+
* ioredis instance crashes the process in some setups, and a dead/reconnecting subscriber emits
|
|
75
|
+
* them in bursts — so this connection, which nothing else listens to, would take the app down.
|
|
76
|
+
*/
|
|
77
|
+
trackSubscriber(sub) {
|
|
78
|
+
let loggedSinceReady = false;
|
|
79
|
+
sub.on?.('error', ((err) => {
|
|
80
|
+
if (loggedSinceReady)
|
|
81
|
+
return; // one line per reconnect burst, not one per retry
|
|
82
|
+
loggedSinceReady = true;
|
|
83
|
+
console.warn(`[adonis-durable] control-plane subscriber error: ${err.message}`);
|
|
84
|
+
}));
|
|
85
|
+
sub.on?.('ready', (() => {
|
|
86
|
+
loggedSinceReady = false;
|
|
87
|
+
}));
|
|
88
|
+
this.startPingWatchdog(sub);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Start the watchdog interval, unless it's disabled or already running (idempotent). Unref'd so
|
|
92
|
+
* it never keeps the process alive on its own; cleared in {@link close}.
|
|
93
|
+
*/
|
|
94
|
+
startPingWatchdog(sub) {
|
|
95
|
+
if (this.pingWatchdogTimer || this.pingIntervalMs === false)
|
|
96
|
+
return;
|
|
97
|
+
if (typeof sub.ping !== 'function')
|
|
98
|
+
return; // not an ioredis-shaped connection — nothing to probe
|
|
99
|
+
this.pingWatchdogTimer = setInterval(() => {
|
|
100
|
+
void this.pingSubscriber(sub);
|
|
101
|
+
}, this.pingIntervalMs);
|
|
102
|
+
this.pingWatchdogTimer.unref?.();
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* PING the subscriber; on rejection or timeout, `disconnect(true)` so ioredis's `retryStrategy`
|
|
106
|
+
* reconnects and `autoResubscribe` restores the channel. Skips a connection that isn't `'ready'`
|
|
107
|
+
* — it's already mid-(re)connect, so a fresh ping would just race that cycle.
|
|
108
|
+
*
|
|
109
|
+
* The timeout is capped at `pingIntervalMs` itself (never above `SUBSCRIBER_PING_TIMEOUT_MS`):
|
|
110
|
+
* waiting longer than the gap between checks to declare one dead would just mean two checks race
|
|
111
|
+
* each other, and it lets a short interval shrink the whole detect → reconnect cycle instead of
|
|
112
|
+
* always eating the full multi-second default.
|
|
113
|
+
*/
|
|
114
|
+
async pingSubscriber(sub) {
|
|
115
|
+
if (sub.status !== undefined && sub.status !== 'ready')
|
|
116
|
+
return;
|
|
117
|
+
const timeoutMs = this.pingIntervalMs === false
|
|
118
|
+
? SUBSCRIBER_PING_TIMEOUT_MS
|
|
119
|
+
: Math.min(SUBSCRIBER_PING_TIMEOUT_MS, this.pingIntervalMs);
|
|
120
|
+
try {
|
|
121
|
+
await new Promise((resolve, reject) => {
|
|
122
|
+
const timer = setTimeout(() => reject(new Error('ping timed out')), timeoutMs);
|
|
123
|
+
sub
|
|
124
|
+
.ping?.()
|
|
125
|
+
.then(() => {
|
|
126
|
+
clearTimeout(timer);
|
|
127
|
+
resolve();
|
|
128
|
+
})
|
|
129
|
+
.catch((err) => {
|
|
130
|
+
clearTimeout(timer);
|
|
131
|
+
reject(err instanceof Error ? err : new Error(String(err)));
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
catch (err) {
|
|
136
|
+
// A ping in flight when close() lands would otherwise RESURRECT the connection we just tore
|
|
137
|
+
// down: disconnect(true) reconnects rather than closes. Re-check after the await.
|
|
138
|
+
if (this.closed)
|
|
139
|
+
return;
|
|
140
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
141
|
+
console.warn(`[adonis-durable] control-plane subscriber unresponsive (${message}) — reconnecting to restore its subscription`);
|
|
142
|
+
sub.disconnect?.(true);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/** Stop the watchdog and tear down the dedicated subscriber connection (ioredis path). */
|
|
52
146
|
async close() {
|
|
147
|
+
this.closed = true;
|
|
148
|
+
if (this.pingWatchdogTimer)
|
|
149
|
+
clearInterval(this.pingWatchdogTimer);
|
|
150
|
+
this.pingWatchdogTimer = undefined;
|
|
53
151
|
this.subscriber?.disconnect?.();
|
|
54
152
|
this.subscriber = undefined;
|
|
55
153
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis-control-plane.js","sourceRoot":"","sources":["../../../src/control-plane-redis/redis-control-plane.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"redis-control-plane.js","sourceRoot":"","sources":["../../../src/control-plane-redis/redis-control-plane.ts"],"names":[],"mappings":"AAqEA,+DAA+D;AAC/D,MAAM,wBAAwB,GAAG,MAAM,CAAC;AACxC,uFAAuF;AACvF,MAAM,0BAA0B,GAAG,KAAK,CAAC;AAEzC;;;GAGG;AACH,SAAS,qBAAqB,CAAC,KAAiC;IAC9D,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,wBAAwB,CAAC;IACzD,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACjD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,iBAAiB;IACX,UAAU,CAAc;IACxB,OAAO,CAAS;IACzB,UAAU,CAA0B;IACpC,UAAU,GAAG,KAAK,CAAC;IACV,cAAc,CAAiB;IACxC,iBAAiB,CAA6C;IAC9D,MAAM,GAAG,KAAK,CAAC;IAEvB,YAAY,OA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