@dbos-inc/dbos-sdk 4.28.11-preview → 4.28.13-preview
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 +1 -1
- package/dist/src/adminserver.d.ts +0 -1
- package/dist/src/adminserver.d.ts.map +1 -1
- package/dist/src/adminserver.js +1 -2
- package/dist/src/adminserver.js.map +1 -1
- package/dist/src/conductor/conductor.js +2 -2
- package/dist/src/conductor/conductor.js.map +1 -1
- package/dist/src/conductor/protocol.d.ts +1 -0
- package/dist/src/conductor/protocol.d.ts.map +1 -1
- package/dist/src/conductor/protocol.js.map +1 -1
- package/dist/src/datasource.d.ts.map +1 -1
- package/dist/src/datasource.js +0 -6
- package/dist/src/datasource.js.map +1 -1
- package/dist/src/dbos-executor.d.ts +0 -11
- package/dist/src/dbos-executor.d.ts.map +1 -1
- package/dist/src/dbos-executor.js +7 -98
- package/dist/src/dbos-executor.js.map +1 -1
- package/dist/src/dbos.d.ts +4 -2
- package/dist/src/dbos.d.ts.map +1 -1
- package/dist/src/dbos.js +7 -17
- package/dist/src/dbos.js.map +1 -1
- package/dist/src/decorators.d.ts +0 -6
- package/dist/src/decorators.d.ts.map +1 -1
- package/dist/src/decorators.js +1 -19
- package/dist/src/decorators.js.map +1 -1
- package/dist/src/error.d.ts +0 -6
- package/dist/src/error.d.ts.map +1 -1
- package/dist/src/error.js +1 -15
- package/dist/src/error.js.map +1 -1
- package/dist/src/eventreceiver.d.ts +1 -1
- package/dist/src/eventreceiver.d.ts.map +1 -1
- package/dist/src/eventreceiver.js +2 -1
- package/dist/src/eventreceiver.js.map +1 -1
- package/dist/src/serialization.d.ts +1 -13
- package/dist/src/serialization.d.ts.map +1 -1
- package/dist/src/serialization.js +27 -122
- package/dist/src/serialization.js.map +1 -1
- package/dist/src/step.d.ts +1 -0
- package/dist/src/step.d.ts.map +1 -1
- package/dist/src/step.js.map +1 -1
- package/dist/src/sysdb_migrations/internal/migrations.js +1 -6
- package/dist/src/sysdb_migrations/internal/migrations.js.map +1 -1
- package/dist/src/system_database.d.ts +1 -1
- package/dist/src/system_database.d.ts.map +1 -1
- package/dist/src/system_database.js +34 -36
- package/dist/src/system_database.js.map +1 -1
- package/dist/src/telemetry/collector.d.ts.map +1 -1
- package/dist/src/telemetry/collector.js +0 -1
- package/dist/src/telemetry/collector.js.map +1 -1
- package/dist/src/utils.d.ts +0 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +1 -5
- package/dist/src/utils.js.map +1 -1
- package/dist/src/wfqueue.d.ts +4 -26
- package/dist/src/wfqueue.d.ts.map +1 -1
- package/dist/src/wfqueue.js +43 -125
- package/dist/src/wfqueue.js.map +1 -1
- package/dist/src/workflow.d.ts +0 -3
- package/dist/src/workflow.d.ts.map +1 -1
- package/dist/src/workflow.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../../src/telemetry/collector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../../src/telemetry/collector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAkBjD,qBAAa,kBAAkB;IAQjB,QAAQ,CAAC,QAAQ,CAAC;IAN9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoC;IAC5D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAGhD,OAAO,CAAC,QAAQ,CAAC,iCAAiC,CAAO;gBAEpC,QAAQ,CAAC,gCAAoB;IAM5C,OAAO;IAMb,IAAI,CAAC,MAAM,EAAE,MAAM;IAInB,OAAO,CAAC,GAAG;IAIL,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;CAmB/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector.js","sourceRoot":"","sources":["../../../src/telemetry/collector.ts"],"names":[],"mappings":";;;AAEA,MAAM,YAAY;IAChB,IAAI,GAAa,EAAE,CAAC;IAEpB,IAAI,CAAC,MAAc;QACjB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;IAED,GAAG;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAC1B,CAAC;CACF;AAED,
|
|
1
|
+
{"version":3,"file":"collector.js","sourceRoot":"","sources":["../../../src/telemetry/collector.ts"],"names":[],"mappings":";;;AAEA,MAAM,YAAY;IAChB,IAAI,GAAa,EAAE,CAAC;IAEpB,IAAI,CAAC,MAAc;QACjB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;IAED,GAAG;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAC1B,CAAC;CACF;AAED,MAAa,kBAAkB;IAQR;IAPrB,4BAA4B;IACX,OAAO,GAAiB,IAAI,YAAY,EAAE,CAAC;IAC3C,cAAc,CAAiB;IAEhD,uEAAuE;IACtD,iCAAiC,GAAG,GAAG,CAAC;IAEzD,YAAqB,QAA6B;QAA7B,aAAQ,GAAR,QAAQ,CAAqB;QAChD,IAAI,CAAC,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;YACrC,KAAK,IAAI,CAAC,uBAAuB,EAAE,CAAC;QACtC,CAAC,EAAE,IAAI,CAAC,iCAAiC,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,OAAO;QACX,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACnC,MAAM,IAAI,CAAC,uBAAuB,EAAE,CAAC;QACrC,MAAM,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC/B,CAAC;IAED,IAAI,CAAC,MAAc;QACjB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAEO,GAAG;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,uBAAuB;QAC3B,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;YAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAC1B,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,MAAM;YACR,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrB,CAAC;QACD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAClB,IAAI,CAAC;oBACH,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACpC,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,OAAO,CAAC,KAAK,CAAE,CAAW,CAAC,OAAO,CAAC,CAAC;gBACtC,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF;AA/CD,gDA+CC"}
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -57,7 +57,6 @@ export declare function interruptibleSleep(ms: number, signal: AbortSignal): Pro
|
|
|
57
57
|
/** Resolve once `signal` aborts. One-shot listener, auto-removed on fire. */
|
|
58
58
|
export declare function waitForAbort(signal: AbortSignal): Promise<void>;
|
|
59
59
|
export type ValuesOf<T> = T[keyof T];
|
|
60
|
-
export declare function exhaustiveCheckGuard(_: never): never;
|
|
61
60
|
export declare function interceptStreams(onMessage: (msg: string, stream: 'stdout' | 'stderr') => void): void;
|
|
62
61
|
export declare function getClientConfig(databaseUrl: string | URL): {
|
|
63
62
|
connectionString: string;
|
package/dist/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";AAMA,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,cAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,CAE/F;AAqCD,wBAAgB,iBAAiB,YAEhC;AAED,eAAO,MAAM,YAAY;;;;;;;;;;CAUxB,CAAC;AACF,eAAO,MAAM,OAAO,OAAQ,MAAM,qBAA0C,CAAC;AAG7E,eAAO,MAAM,WAAW;;CAEvB,CAAC;AAGF,eAAO,MAAM,aAAa;;;CAGzB,CAAC;AAGF,eAAO,MAAM,0BAA0B,WAAW,CAAC;AAGnD,eAAO,MAAM,mBAAmB,yBAAyB,CAAC;AAQ1D,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM;;;EAwB1C;AAED;;;;;;;GAOG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;IACjD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;gBAEtB,KAAK,EAAE,MAAM;IAKzB,8EAA8E;IAC9E,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAWxB,2EAA2E;IAC3E,OAAO,IAAI,IAAI;IAWf,8EAA8E;IACxE,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CAQxD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAajF;AAED,6EAA6E;AAC7E,wBAAg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wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAK/D;AAED,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAMrC,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAG,QAAQ,KAAK,IAAI,QAkB7F;AAGD,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG;;;EAiBxD"}
|
package/dist/src/utils.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getClientConfig = exports.interceptStreams = exports.
|
|
6
|
+
exports.getClientConfig = exports.interceptStreams = exports.waitForAbort = exports.interruptibleSleep = exports.Semaphore = exports.cancellableSleep = exports.INTERNAL_QUEUE_NAME = exports.RESERVED_QUEUE_NAME_PREFIX = exports.dbRetryConfig = exports.sleepConfig = exports.sleepms = exports.globalParams = exports.defaultEnableOTLP = exports.readFile = void 0;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
/*
|
|
@@ -189,10 +189,6 @@ function waitForAbort(signal) {
|
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
191
|
exports.waitForAbort = waitForAbort;
|
|
192
|
-
function exhaustiveCheckGuard(_) {
|
|
193
|
-
throw new Error('Exaustive matching is not applied');
|
|
194
|
-
}
|
|
195
|
-
exports.exhaustiveCheckGuard = exhaustiveCheckGuard;
|
|
196
192
|
// Capture original functions
|
|
197
193
|
const originalStdoutWrite = process.stdout.write.bind(process.stdout);
|
|
198
194
|
const originalStderrWrite = process.stderr.write.bind(process.stderr);
|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;IACjG,OAAO;QACL,gBAAgB;QAChB,uBAAuB,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK;KAC1D,CAAC;IAEF,SAAS,UAAU,CAAC,GAAQ;QAC1B,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;YACzD,OAAO,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9D,CAAC;QAAC,MAAM,CAAC;YACP,yDAAyD;YACzD,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;AACH,CAAC;AAjBD,0CAiBC"}
|
package/dist/src/wfqueue.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { GlobalLogger } from './telemetry/logs';
|
|
|
4
4
|
/**
|
|
5
5
|
* Log a single queue's name and its set parameters. Unset parameters are
|
|
6
6
|
* omitted, matching `Queue: <name> (concurrency=…, worker_concurrency=…,
|
|
7
|
-
* limit=N/Ts,
|
|
7
|
+
* limit=N/Ts, partition_concurrency=…)`.
|
|
8
8
|
*/
|
|
9
9
|
export declare function logQueue(logger: GlobalLogger, q: WorkflowQueue): void;
|
|
10
10
|
/**
|
|
@@ -43,10 +43,6 @@ export interface QueueParameters {
|
|
|
43
43
|
minPollingIntervalMs?: number;
|
|
44
44
|
/** @deprecated Use `globalConcurrency`. */
|
|
45
45
|
concurrency?: number;
|
|
46
|
-
/** @deprecated Priority is always enabled. */
|
|
47
|
-
priorityEnabled?: boolean;
|
|
48
|
-
/** @deprecated Use the partition limits, any of which partitions the queue. */
|
|
49
|
-
partitionQueue?: boolean;
|
|
50
46
|
}
|
|
51
47
|
/**
|
|
52
48
|
* Behavior of `DBOS.registerQueue` / `DBOSClient.registerQueue` when a queue
|
|
@@ -64,17 +60,8 @@ export interface RegisterQueueOptions extends QueueParameters {
|
|
|
64
60
|
/** How to behave when a queue with the same name already exists. */
|
|
65
61
|
onConflict?: QueueConflictResolution;
|
|
66
62
|
}
|
|
67
|
-
/**
|
|
68
|
-
export
|
|
69
|
-
globalConcurrency?: number;
|
|
70
|
-
workerConcurrency?: number;
|
|
71
|
-
rateLimit?: QueueRateLimit;
|
|
72
|
-
partitionConcurrency?: number;
|
|
73
|
-
partitionWorkerConcurrency?: number;
|
|
74
|
-
partitionRateLimit?: QueueRateLimit;
|
|
75
|
-
}
|
|
76
|
-
/** Resolve every limit on a queue to the scope it is actually enforced at. */
|
|
77
|
-
export declare function resolveQueueLimits(q: WorkflowQueue): ResolvedQueueLimits;
|
|
63
|
+
/** True when a queue is partitioned, which is to say any per-partition limit is set on it. */
|
|
64
|
+
export declare function isPartitionedQueue(queue: WorkflowQueue): boolean;
|
|
78
65
|
/**
|
|
79
66
|
* Settings structure for a named workflow queue.
|
|
80
67
|
* Workflow queues limit the rate and concurrency at which DBOS executes workflows.
|
|
@@ -86,12 +73,11 @@ export declare class WorkflowQueue {
|
|
|
86
73
|
/**
|
|
87
74
|
* Last-known cached values. May be stale for database-backed queues if
|
|
88
75
|
* another process has modified the row. Use getters instead.
|
|
76
|
+
* `concurrency` is the queue-wide limit, across every worker and partition.
|
|
89
77
|
*/
|
|
90
78
|
concurrency?: number;
|
|
91
79
|
rateLimit?: QueueRateLimit;
|
|
92
80
|
workerConcurrency?: number;
|
|
93
|
-
priorityEnabled: boolean;
|
|
94
|
-
partitionQueue: boolean;
|
|
95
81
|
partitionConcurrency?: number;
|
|
96
82
|
partitionWorkerConcurrency?: number;
|
|
97
83
|
partitionRateLimit?: QueueRateLimit;
|
|
@@ -138,10 +124,6 @@ export declare class WorkflowQueue {
|
|
|
138
124
|
setPartitionConcurrency(value: number | undefined): Promise<void>;
|
|
139
125
|
setPartitionWorkerConcurrency(value: number | undefined): Promise<void>;
|
|
140
126
|
setPartitionRateLimit(value: QueueRateLimit | undefined): Promise<void>;
|
|
141
|
-
/** @deprecated Priority is always enabled. */
|
|
142
|
-
setPriorityEnabled(value: boolean): Promise<void>;
|
|
143
|
-
/** @deprecated Use the partition limit setters. */
|
|
144
|
-
setPartitionQueue(value: boolean): Promise<void>;
|
|
145
127
|
setMinPollingIntervalMs(value: number): Promise<void>;
|
|
146
128
|
/** @deprecated Use `getGlobalConcurrency`. */
|
|
147
129
|
getConcurrency(): Promise<number | undefined>;
|
|
@@ -151,10 +133,6 @@ export declare class WorkflowQueue {
|
|
|
151
133
|
getPartitionConcurrency(): Promise<number | undefined>;
|
|
152
134
|
getPartitionWorkerConcurrency(): Promise<number | undefined>;
|
|
153
135
|
getPartitionRateLimit(): Promise<QueueRateLimit | undefined>;
|
|
154
|
-
/** @deprecated Priority is always enabled. */
|
|
155
|
-
getPriorityEnabled(): Promise<boolean>;
|
|
156
|
-
/** @deprecated Use the partition limit getters. */
|
|
157
|
-
getPartitionQueue(): Promise<boolean>;
|
|
158
136
|
getMinPollingIntervalMs(): Promise<number | undefined>;
|
|
159
137
|
}
|
|
160
138
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wfqueue.d.ts","sourceRoot":"","sources":["../../src/wfqueue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAM/C,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,EAAE,aAAa,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"wfqueue.d.ts","sourceRoot":"","sources":["../../src/wfqueue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAM/C,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBA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AAC,QAAQ,CAAC,mBAAmB,CAAgB;IAC3D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAgB;IAC5D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAe;IAC7C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAe;IAC/C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgB;IAC1C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgB;IAE1C,gBAAgB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAI5C,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAIzD,IAAI;IAMJ,kBAAkB;IAKZ,YAAY,CAChB,IAAI,EAAE,YAAY,EAClB,eAAe,EAAE,MAAM,EAAE,GAAG,IAAI,EAChC,4BAA4B,GAAE,MAAU,GACvC,OAAO,CAAC,IAAI,CAAC;IAuBhB,8FAA8F;IAC9F,OAAO,CAAC,WAAW;IAMnB,oGAAoG;YACtF,eAAe;IAwC7B,uFAAuF;IACvF,OAAO,CAAC,gBAAgB;IAQxB,4FAA4F;YAC9E,aAAa;IAmF3B,+GAA+G;IAC/G,OAAO,CAAC,iBAAiB;IAmBzB,iGAAiG;YACnF,YAAY;IAoB1B,iGAAiG;YACnF,SAAS;IA+EvB,8HAA8H;IAC9H,OAAO,CAAC,cAAc;CAgBvB;AAED,eAAO,MAAM,aAAa,eAAsB,CAAC"}
|
package/dist/src/wfqueue.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.wfQueueRunner = exports.registerInternalQueue = exports.WorkflowQueue = exports.
|
|
3
|
+
exports.wfQueueRunner = exports.registerInternalQueue = exports.WorkflowQueue = exports.isPartitionedQueue = exports.logQueue = void 0;
|
|
4
4
|
const dbos_executor_1 = require("./dbos-executor");
|
|
5
5
|
const debugpoint_1 = require("./debugpoint");
|
|
6
6
|
const utils_1 = require("./utils");
|
|
7
7
|
/**
|
|
8
8
|
* Log a single queue's name and its set parameters. Unset parameters are
|
|
9
9
|
* omitted, matching `Queue: <name> (concurrency=…, worker_concurrency=…,
|
|
10
|
-
* limit=N/Ts,
|
|
10
|
+
* limit=N/Ts, partition_concurrency=…)`.
|
|
11
11
|
*/
|
|
12
12
|
function logQueue(logger, q) {
|
|
13
13
|
const opts = [];
|
|
14
14
|
if (q.concurrency !== undefined) {
|
|
15
15
|
// On a partitioned queue the queue-wide scope is worth naming explicitly.
|
|
16
|
-
opts.push(`${
|
|
16
|
+
opts.push(`${isPartitionedQueue(q) ? 'global_concurrency' : 'concurrency'}=${q.concurrency}`);
|
|
17
17
|
}
|
|
18
18
|
if (q.workerConcurrency !== undefined)
|
|
19
19
|
opts.push(`worker_concurrency=${q.workerConcurrency}`);
|
|
@@ -27,60 +27,38 @@ function logQueue(logger, q) {
|
|
|
27
27
|
if (q.partitionRateLimit !== undefined) {
|
|
28
28
|
opts.push(`partition_limit=${q.partitionRateLimit.limitPerPeriod}/${q.partitionRateLimit.periodSec}s`);
|
|
29
29
|
}
|
|
30
|
-
if (q.priorityEnabled)
|
|
31
|
-
opts.push('priority');
|
|
32
|
-
if (q.partitionQueue)
|
|
33
|
-
opts.push('partitioned');
|
|
34
30
|
const optsStr = opts.length > 0 ? ` (${opts.join(', ')})` : '';
|
|
35
31
|
logger.info(`Queue: ${q.name}${optsStr}`);
|
|
36
32
|
}
|
|
37
33
|
exports.logQueue = logQueue;
|
|
34
|
+
/**
|
|
35
|
+
* Options removed in 5.0, and what replaces each.
|
|
36
|
+
*/
|
|
37
|
+
const REMOVED_QUEUE_PARAMS = {
|
|
38
|
+
priorityEnabled: 'every queue dispatches in priority order, so the option can be deleted',
|
|
39
|
+
partitionQueue: 'set partitionConcurrency, partitionWorkerConcurrency, or partitionRateLimit instead, any of which partitions the queue',
|
|
40
|
+
};
|
|
38
41
|
/** True when any per-partition limit is set, which is what partitions a queue. */
|
|
39
42
|
function hasPartitionLimits(limits) {
|
|
40
43
|
return (limits.partitionConcurrency !== undefined ||
|
|
41
44
|
limits.partitionWorkerConcurrency !== undefined ||
|
|
42
45
|
limits.partitionRateLimit !== undefined);
|
|
43
46
|
}
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
*/
|
|
48
|
-
function isLegacyPartitioned(q) {
|
|
49
|
-
return q.partitionQueue && !hasPartitionLimits(q);
|
|
50
|
-
}
|
|
51
|
-
/** Resolve every limit on a queue to the scope it is actually enforced at. */
|
|
52
|
-
function resolveQueueLimits(q) {
|
|
53
|
-
if (isLegacyPartitioned(q)) {
|
|
54
|
-
return {
|
|
55
|
-
partitionConcurrency: q.concurrency,
|
|
56
|
-
partitionWorkerConcurrency: q.workerConcurrency,
|
|
57
|
-
partitionRateLimit: q.rateLimit,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
return {
|
|
61
|
-
globalConcurrency: q.concurrency,
|
|
62
|
-
workerConcurrency: q.workerConcurrency,
|
|
63
|
-
rateLimit: q.rateLimit,
|
|
64
|
-
partitionConcurrency: q.partitionConcurrency,
|
|
65
|
-
partitionWorkerConcurrency: q.partitionWorkerConcurrency,
|
|
66
|
-
partitionRateLimit: q.partitionRateLimit,
|
|
67
|
-
};
|
|
47
|
+
/** True when a queue is partitioned, which is to say any per-partition limit is set on it. */
|
|
48
|
+
function isPartitionedQueue(queue) {
|
|
49
|
+
return hasPartitionLimits(queue);
|
|
68
50
|
}
|
|
69
|
-
exports.
|
|
51
|
+
exports.isPartitionedQueue = isPartitionedQueue;
|
|
70
52
|
/**
|
|
71
53
|
* Room left under this worker's queue-wide concurrency limit, given how many of
|
|
72
54
|
* its workflows are already running or claimed.
|
|
73
55
|
*/
|
|
74
|
-
function workerBudget(
|
|
75
|
-
if (
|
|
76
|
-
//
|
|
77
|
-
return 0;
|
|
78
|
-
}
|
|
79
|
-
if (limits.workerConcurrency === undefined) {
|
|
80
|
-
// A non-zero per-partition worker limit is enforced per partition instead.
|
|
56
|
+
function workerBudget(queue, running) {
|
|
57
|
+
if (queue.workerConcurrency === undefined) {
|
|
58
|
+
// A per-partition worker limit is enforced per partition instead.
|
|
81
59
|
return Infinity;
|
|
82
60
|
}
|
|
83
|
-
return Math.max(0,
|
|
61
|
+
return Math.max(0, queue.workerConcurrency - running);
|
|
84
62
|
}
|
|
85
63
|
/** 40001 serialization_failure or 55P03 lock_not_available: a peer is claiming the same rows. */
|
|
86
64
|
function isContentionError(e) {
|
|
@@ -119,14 +97,6 @@ function sysDBFor(q) {
|
|
|
119
97
|
}
|
|
120
98
|
return exec.systemDatabase;
|
|
121
99
|
}
|
|
122
|
-
/** Reject a write that would silently re-scope the other limits on a legacy queue. */
|
|
123
|
-
function requireNotLegacyPartitioned(q, field) {
|
|
124
|
-
if (isLegacyPartitioned(q)) {
|
|
125
|
-
throw new Error(`Cannot set ${field} on queue ${q.name}: it is registered with the deprecated partitionQueue option, ` +
|
|
126
|
-
`under which concurrency, workerConcurrency, and rateLimit apply per partition. ` +
|
|
127
|
-
`Re-register the queue with the partition limits instead.`);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
100
|
/** Validate a new queue-wide concurrency against the queue's other cached limits. */
|
|
131
101
|
function checkConcurrencyBounds(q, value) {
|
|
132
102
|
if (value === undefined)
|
|
@@ -158,12 +128,9 @@ function applyRecord(q, record) {
|
|
|
158
128
|
q.concurrency = record.concurrency ?? undefined;
|
|
159
129
|
q.workerConcurrency = record.workerConcurrency ?? undefined;
|
|
160
130
|
q.rateLimit = rateLimitFromRecord(record.rateLimitMax, record.rateLimitPeriodSec);
|
|
161
|
-
q.priorityEnabled = record.priorityEnabled;
|
|
162
131
|
q.partitionConcurrency = record.partitionConcurrency ?? undefined;
|
|
163
132
|
q.partitionWorkerConcurrency = record.partitionWorkerConcurrency ?? undefined;
|
|
164
133
|
q.partitionRateLimit = rateLimitFromRecord(record.partitionRateLimitMax, record.partitionRateLimitPeriodSec);
|
|
165
|
-
// Partitioning is inferred from the limits, so a row whose flag disagrees with them heals on read.
|
|
166
|
-
q.partitionQueue = record.partitionQueue || hasPartitionLimits(q);
|
|
167
134
|
q.minPollingIntervalMs = record.pollingIntervalSec * 1000;
|
|
168
135
|
q.applicationName = record.applicationName;
|
|
169
136
|
}
|
|
@@ -192,12 +159,11 @@ class WorkflowQueue {
|
|
|
192
159
|
/**
|
|
193
160
|
* Last-known cached values. May be stale for database-backed queues if
|
|
194
161
|
* another process has modified the row. Use getters instead.
|
|
162
|
+
* `concurrency` is the queue-wide limit, across every worker and partition.
|
|
195
163
|
*/
|
|
196
164
|
concurrency;
|
|
197
165
|
rateLimit;
|
|
198
166
|
workerConcurrency;
|
|
199
|
-
priorityEnabled = false;
|
|
200
|
-
partitionQueue = false;
|
|
201
167
|
partitionConcurrency;
|
|
202
168
|
partitionWorkerConcurrency;
|
|
203
169
|
partitionRateLimit;
|
|
@@ -247,16 +213,15 @@ class WorkflowQueue {
|
|
|
247
213
|
}
|
|
248
214
|
/** Throws if any combination of queue parameters is invalid. */
|
|
249
215
|
static validateQueueParams(params) {
|
|
250
|
-
const
|
|
216
|
+
for (const [option, replacement] of Object.entries(REMOVED_QUEUE_PARAMS)) {
|
|
217
|
+
if (Object.hasOwn(params, option)) {
|
|
218
|
+
throw new Error(`${option} was removed: ${replacement}.`);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
const { concurrency, globalConcurrency, workerConcurrency, rateLimit, partitionConcurrency, partitionWorkerConcurrency, partitionRateLimit, minPollingIntervalMs, } = params;
|
|
251
222
|
if (concurrency !== undefined && globalConcurrency !== undefined) {
|
|
252
223
|
throw new Error('concurrency is deprecated in favor of globalConcurrency; set only one of them');
|
|
253
224
|
}
|
|
254
|
-
if (partitionQueue && hasPartitionLimits(params)) {
|
|
255
|
-
throw new Error('partitionQueue is deprecated in favor of the partition limits; set only one of them');
|
|
256
|
-
}
|
|
257
|
-
if (partitionQueue && globalConcurrency !== undefined) {
|
|
258
|
-
throw new Error('partitionQueue applies every limit per partition, so it cannot be combined with globalConcurrency; use partitionConcurrency instead');
|
|
259
|
-
}
|
|
260
225
|
if (partitionConcurrency !== undefined && partitionConcurrency < 1) {
|
|
261
226
|
throw new Error('partitionConcurrency must be at least 1');
|
|
262
227
|
}
|
|
@@ -277,7 +242,6 @@ class WorkflowQueue {
|
|
|
277
242
|
partitionWorkerConcurrency > workerConcurrency) {
|
|
278
243
|
throw new Error('workerConcurrency must be greater than or equal to partitionWorkerConcurrency');
|
|
279
244
|
}
|
|
280
|
-
// Under the deprecated partitionQueue mode concurrency is itself a per-partition limit, so these compare like with like.
|
|
281
245
|
const queueConcurrency = globalConcurrency ?? concurrency;
|
|
282
246
|
if (workerConcurrency !== undefined && queueConcurrency !== undefined && workerConcurrency > queueConcurrency) {
|
|
283
247
|
throw new Error('concurrency must be greater than or equal to workerConcurrency');
|
|
@@ -307,9 +271,7 @@ class WorkflowQueue {
|
|
|
307
271
|
workerConcurrency: params.workerConcurrency ?? null,
|
|
308
272
|
rateLimitMax: params.rateLimit ? params.rateLimit.limitPerPeriod : null,
|
|
309
273
|
rateLimitPeriodSec: params.rateLimit ? params.rateLimit.periodSec : null,
|
|
310
|
-
|
|
311
|
-
// Any per-partition limit implies partitioning, whichever mode was used.
|
|
312
|
-
partitionQueue: (params.partitionQueue ?? false) || hasPartitionLimits(params),
|
|
274
|
+
partitionQueue: hasPartitionLimits(params),
|
|
313
275
|
partitionConcurrency: params.partitionConcurrency ?? null,
|
|
314
276
|
partitionWorkerConcurrency: params.partitionWorkerConcurrency ?? null,
|
|
315
277
|
partitionRateLimitMax: params.partitionRateLimit ? params.partitionRateLimit.limitPerPeriod : null,
|
|
@@ -319,17 +281,12 @@ class WorkflowQueue {
|
|
|
319
281
|
}
|
|
320
282
|
/** @deprecated Use `setGlobalConcurrency`. */
|
|
321
283
|
async setConcurrency(value) {
|
|
322
|
-
|
|
323
|
-
// Refresh so the cross-field checks see the limits currently stored in the database.
|
|
324
|
-
await refreshFromDb(this);
|
|
325
|
-
checkConcurrencyBounds(this, value);
|
|
326
|
-
await sysDBFor(this).updateQueue(this.name, { concurrency: value ?? null });
|
|
327
|
-
this.concurrency = value;
|
|
284
|
+
return this.setGlobalConcurrency(value);
|
|
328
285
|
}
|
|
329
286
|
async setGlobalConcurrency(value) {
|
|
330
287
|
requireDatabaseBacked(this);
|
|
288
|
+
// Refresh so the cross-field checks see the limits currently stored in the database.
|
|
331
289
|
await refreshFromDb(this);
|
|
332
|
-
requireNotLegacyPartitioned(this, 'globalConcurrency');
|
|
333
290
|
checkConcurrencyBounds(this, value);
|
|
334
291
|
await sysDBFor(this).updateQueue(this.name, { concurrency: value ?? null });
|
|
335
292
|
this.concurrency = value;
|
|
@@ -337,7 +294,6 @@ class WorkflowQueue {
|
|
|
337
294
|
async setWorkerConcurrency(value) {
|
|
338
295
|
requireDatabaseBacked(this);
|
|
339
296
|
await refreshFromDb(this);
|
|
340
|
-
requireNotLegacyPartitioned(this, 'workerConcurrency');
|
|
341
297
|
if (value !== undefined) {
|
|
342
298
|
if (this.concurrency !== undefined && value > this.concurrency) {
|
|
343
299
|
throw new Error('workerConcurrency must be less than or equal to concurrency');
|
|
@@ -354,9 +310,6 @@ class WorkflowQueue {
|
|
|
354
310
|
if (value !== undefined && (value.limitPerPeriod === undefined || value.periodSec === undefined)) {
|
|
355
311
|
throw new Error('rateLimit must specify both limitPerPeriod and periodSec');
|
|
356
312
|
}
|
|
357
|
-
// Refresh so the check below sees the partition limits currently stored in the database.
|
|
358
|
-
await refreshFromDb(this);
|
|
359
|
-
requireNotLegacyPartitioned(this, 'rateLimit');
|
|
360
313
|
await sysDBFor(this).updateQueue(this.name, {
|
|
361
314
|
rateLimitMax: value ? value.limitPerPeriod : null,
|
|
362
315
|
rateLimitPeriodSec: value ? value.periodSec : null,
|
|
@@ -369,7 +322,6 @@ class WorkflowQueue {
|
|
|
369
322
|
throw new Error('partitionConcurrency must be at least 1');
|
|
370
323
|
}
|
|
371
324
|
await refreshFromDb(this);
|
|
372
|
-
requireNotLegacyPartitioned(this, 'partitionConcurrency');
|
|
373
325
|
if (value !== undefined) {
|
|
374
326
|
if (this.concurrency !== undefined && value > this.concurrency) {
|
|
375
327
|
throw new Error('partitionConcurrency must be less than or equal to globalConcurrency');
|
|
@@ -378,14 +330,13 @@ class WorkflowQueue {
|
|
|
378
330
|
throw new Error('partitionConcurrency must be greater than or equal to partitionWorkerConcurrency');
|
|
379
331
|
}
|
|
380
332
|
}
|
|
381
|
-
// Partitioning is inferred from the limits, so the
|
|
333
|
+
// Partitioning is inferred from the limits, so the stored flag follows them.
|
|
382
334
|
const partitioned = partitionedAfter(this, { partitionConcurrency: value });
|
|
383
335
|
await sysDBFor(this).updateQueue(this.name, {
|
|
384
336
|
partitionConcurrency: value ?? null,
|
|
385
337
|
partitionQueue: partitioned,
|
|
386
338
|
});
|
|
387
339
|
this.partitionConcurrency = value;
|
|
388
|
-
this.partitionQueue = partitioned;
|
|
389
340
|
}
|
|
390
341
|
async setPartitionWorkerConcurrency(value) {
|
|
391
342
|
requireDatabaseBacked(this);
|
|
@@ -393,7 +344,6 @@ class WorkflowQueue {
|
|
|
393
344
|
throw new Error('partitionWorkerConcurrency must be at least 1');
|
|
394
345
|
}
|
|
395
346
|
await refreshFromDb(this);
|
|
396
|
-
requireNotLegacyPartitioned(this, 'partitionWorkerConcurrency');
|
|
397
347
|
if (value !== undefined) {
|
|
398
348
|
if (this.partitionConcurrency !== undefined && value > this.partitionConcurrency) {
|
|
399
349
|
throw new Error('partitionWorkerConcurrency must be less than or equal to partitionConcurrency');
|
|
@@ -411,7 +361,6 @@ class WorkflowQueue {
|
|
|
411
361
|
partitionQueue: partitioned,
|
|
412
362
|
});
|
|
413
363
|
this.partitionWorkerConcurrency = value;
|
|
414
|
-
this.partitionQueue = partitioned;
|
|
415
364
|
}
|
|
416
365
|
async setPartitionRateLimit(value) {
|
|
417
366
|
requireDatabaseBacked(this);
|
|
@@ -419,7 +368,6 @@ class WorkflowQueue {
|
|
|
419
368
|
throw new Error('partitionRateLimit must specify both limitPerPeriod and periodSec');
|
|
420
369
|
}
|
|
421
370
|
await refreshFromDb(this);
|
|
422
|
-
requireNotLegacyPartitioned(this, 'partitionRateLimit');
|
|
423
371
|
const partitioned = partitionedAfter(this, { partitionRateLimit: value });
|
|
424
372
|
await sysDBFor(this).updateQueue(this.name, {
|
|
425
373
|
partitionRateLimitMax: value ? value.limitPerPeriod : null,
|
|
@@ -427,24 +375,6 @@ class WorkflowQueue {
|
|
|
427
375
|
partitionQueue: partitioned,
|
|
428
376
|
});
|
|
429
377
|
this.partitionRateLimit = value;
|
|
430
|
-
this.partitionQueue = partitioned;
|
|
431
|
-
}
|
|
432
|
-
/** @deprecated Priority is always enabled. */
|
|
433
|
-
async setPriorityEnabled(value) {
|
|
434
|
-
requireDatabaseBacked(this);
|
|
435
|
-
await sysDBFor(this).updateQueue(this.name, { priorityEnabled: value });
|
|
436
|
-
this.priorityEnabled = value;
|
|
437
|
-
}
|
|
438
|
-
/** @deprecated Use the partition limit setters. */
|
|
439
|
-
async setPartitionQueue(value) {
|
|
440
|
-
requireDatabaseBacked(this);
|
|
441
|
-
// Refresh so the check below sees the partition limits currently stored in the database.
|
|
442
|
-
await refreshFromDb(this);
|
|
443
|
-
if (hasPartitionLimits(this)) {
|
|
444
|
-
throw new Error(`Cannot set partitionQueue on queue ${this.name}: it is partitioned by its partition limits. Clear those instead.`);
|
|
445
|
-
}
|
|
446
|
-
await sysDBFor(this).updateQueue(this.name, { partitionQueue: value });
|
|
447
|
-
this.partitionQueue = value;
|
|
448
378
|
}
|
|
449
379
|
async setMinPollingIntervalMs(value) {
|
|
450
380
|
requireDatabaseBacked(this);
|
|
@@ -456,42 +386,31 @@ class WorkflowQueue {
|
|
|
456
386
|
}
|
|
457
387
|
/** @deprecated Use `getGlobalConcurrency`. */
|
|
458
388
|
async getConcurrency() {
|
|
459
|
-
|
|
460
|
-
return this.concurrency;
|
|
389
|
+
return this.getGlobalConcurrency();
|
|
461
390
|
}
|
|
462
391
|
async getGlobalConcurrency() {
|
|
463
392
|
await refreshFromDb(this);
|
|
464
|
-
return
|
|
393
|
+
return this.concurrency;
|
|
465
394
|
}
|
|
466
395
|
async getWorkerConcurrency() {
|
|
467
396
|
await refreshFromDb(this);
|
|
468
|
-
return
|
|
397
|
+
return this.workerConcurrency;
|
|
469
398
|
}
|
|
470
399
|
async getRateLimit() {
|
|
471
400
|
await refreshFromDb(this);
|
|
472
|
-
return
|
|
401
|
+
return this.rateLimit;
|
|
473
402
|
}
|
|
474
403
|
async getPartitionConcurrency() {
|
|
475
404
|
await refreshFromDb(this);
|
|
476
|
-
return
|
|
405
|
+
return this.partitionConcurrency;
|
|
477
406
|
}
|
|
478
407
|
async getPartitionWorkerConcurrency() {
|
|
479
408
|
await refreshFromDb(this);
|
|
480
|
-
return
|
|
409
|
+
return this.partitionWorkerConcurrency;
|
|
481
410
|
}
|
|
482
411
|
async getPartitionRateLimit() {
|
|
483
412
|
await refreshFromDb(this);
|
|
484
|
-
return
|
|
485
|
-
}
|
|
486
|
-
/** @deprecated Priority is always enabled. */
|
|
487
|
-
async getPriorityEnabled() {
|
|
488
|
-
await refreshFromDb(this);
|
|
489
|
-
return this.priorityEnabled;
|
|
490
|
-
}
|
|
491
|
-
/** @deprecated Use the partition limit getters. */
|
|
492
|
-
async getPartitionQueue() {
|
|
493
|
-
await refreshFromDb(this);
|
|
494
|
-
return this.partitionQueue;
|
|
413
|
+
return this.partitionRateLimit;
|
|
495
414
|
}
|
|
496
415
|
async getMinPollingIntervalMs() {
|
|
497
416
|
await refreshFromDb(this);
|
|
@@ -749,20 +668,19 @@ class WFQueueRunner {
|
|
|
749
668
|
}
|
|
750
669
|
await exec.dispatchDequeuedWorkflows(wfids);
|
|
751
670
|
};
|
|
752
|
-
const limits = resolveQueueLimits(queue);
|
|
753
671
|
const sysdb = exec.systemDatabase;
|
|
754
672
|
// Dequeue workflows for this queue, either in one batched sweep across partitions or one partition at a time.
|
|
755
673
|
try {
|
|
756
|
-
if (!queue
|
|
674
|
+
if (!isPartitionedQueue(queue)) {
|
|
757
675
|
const wfids = await sysdb.findAndMarkStartableWorkflows(queue, exec.executorID, utils_1.globalParams.appVersion, undefined, sysdb.countRunningWorkflowsForQueue(queue.name));
|
|
758
676
|
await dispatch(wfids);
|
|
759
677
|
}
|
|
760
|
-
else if (
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
678
|
+
else if (queue.partitionConcurrency === 1 &&
|
|
679
|
+
queue.concurrency === undefined &&
|
|
680
|
+
queue.rateLimit === undefined &&
|
|
681
|
+
queue.partitionRateLimit === undefined) {
|
|
764
682
|
// Batched path: one transaction claims every partition's head (see findAndMarkStartablePartitionedWorkflows).
|
|
765
|
-
const maxTasks = workerBudget(
|
|
683
|
+
const maxTasks = workerBudget(queue, sysdb.countRunningWorkflowsForQueue(queue.name));
|
|
766
684
|
if (maxTasks > 0) {
|
|
767
685
|
const wfids = await sysdb.findAndMarkStartablePartitionedWorkflows(queue, exec.executorID, utils_1.globalParams.appVersion, maxTasks);
|
|
768
686
|
await dispatch(wfids);
|
|
@@ -775,7 +693,7 @@ class WFQueueRunner {
|
|
|
775
693
|
const running = sysdb.countRunningWorkflowsForQueue(queue.name);
|
|
776
694
|
let claimed = 0;
|
|
777
695
|
for (const partitionKey of partitionKeys) {
|
|
778
|
-
if (workerBudget(
|
|
696
|
+
if (workerBudget(queue, running + claimed) <= 0)
|
|
779
697
|
break;
|
|
780
698
|
let partitionWfids;
|
|
781
699
|
try {
|