@superdurable/dex 1.17.0 → 1.23.0

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
@@ -215,12 +215,15 @@ defaults to the logical CPU count, and `idleStreamsPerQueue` defaults to one.
215
215
  Each stream runs one task at a time. When all slots are busy, the Worker rejects
216
216
  additional assignments for reassignment. The Worker keeps idle streams on each
217
217
  queue even when all slots are busy. After tasks finish, it gracefully closes surplus
218
- idle streams while preserving readiness. With `F` registered Flow types, the
218
+ idle streams while preserving readiness. The SDK sends an upstream Pong every
219
+ 20 seconds while a task runs and stops before its final frame. This interval is
220
+ internal and needs no Worker option. With `F` registered Flow types, the
219
221
  steady-state bound after load drops is
220
- `maxConcurrentTasks + (1 + F) * idleStreamsPerQueue` streams. The transient peak
221
- during a burst remains bounded by the matching caps. Size both options for
222
- `matching.maxConcurrentTasksCap` per app Worker ID per matching owner and
223
- `matching.maxStreams` per Matching instance.
222
+ `maxConcurrentTasks + (1 + F) * idleStreamsPerQueue` streams.
223
+ Allow up to `1 + F` additional streams for 30 seconds after reserve declines.
224
+ The transient peak during a burst remains bounded by the matching caps. Size
225
+ both options for `matching.maxConcurrentTasksCap` per app Worker ID per matching
226
+ owner and `matching.maxStreams` per Matching instance.
224
227
 
225
228
  The Worker rejects an unregistered Step or RPC by name. Dex retries that task
226
229
  on another pull Worker without consuming a Step attempt, including when the
@@ -258,11 +261,11 @@ is at least two, otherwise zero. With the CPU-count default, Steps get one fewer
258
261
  slot than before. Set it explicitly to zero to opt out. With one slot and no
259
262
  explicit reserve, Worker start logs one warning: RPCs may wait behind
260
263
  long-running Steps; use a limit of at least two or set the reserve explicitly.
261
- Flows must stay responsive; Dex cannot prioritize synchronous RPCs like workflow
262
- engines prioritize reads. The value must be nonnegative and less than
263
- `maxConcurrentTasks` after its CPU-count default is resolved; invalid values
264
- fail construction. RPC and Step handlers count together: WaitFor and Execute
265
- tasks, including local attempts, are declined with `NO_CAPACITY` when the busy
264
+ Flows must stay responsive because RPCs share Worker task capacity with Steps.
265
+ The value must be nonnegative and less than `maxConcurrentTasks` after its
266
+ CPU-count default is resolved; invalid values fail construction. RPC and Step
267
+ handlers count together. WaitFor and Execute tasks, including local attempts,
268
+ are declined with `NO_CAPACITY` when the busy
266
269
  count reaches the task limit minus the reserve. API-direct and transactional
267
270
  InvokeWorkerRPC tasks can use the full limit.
268
271
 
@@ -274,16 +277,21 @@ A decline lets Dex try another Worker without consuming an attempt. If all
274
277
  Workers remain at their Step limit, a Step can wait until the dispatch wait
275
278
  expires, then receive `NO_WORKER_AVAILABLE`, consume an attempt, and follow its
276
279
  retry policy, as when all Workers are full. Local attempts wait the local
277
- dispatch wait, then fall back according to their policy. Each queue still keeps
278
- its configured idle streams; a reserve decline does not close a stream or change
279
- registration readiness.
280
+ dispatch wait, then fall back according to their policy. A queue that declines
281
+ a Step for reserved RPC capacity keeps one additional idle stream until 30
282
+ seconds after its last decline. Other queues retain their configured count.
283
+ The Worker does not open the extra stream while all task slots are busy. Set
284
+ `idleStreamsPerQueue` to at least two for heavy Step backlogs. A reserve decline
285
+ does not close a stream or change registration readiness.
280
286
 
281
287
  Each reserve decline records the Flow type through node:util debuglog under
282
288
  dex:pull (enable with NODE_DEBUG=dex:pull). Export the cumulative
283
289
  `pullReservedRpcDeclines` Worker value to distinguish reserve pressure from
284
- full-capacity rejections. The count excludes full-capacity rejections and
285
- unknown names, never resets, and remains available after shutdown. Listening
286
- Workers return zero.
290
+ full-capacity rejections. The count excludes full-capacity rejections and unknown
291
+ names. It counts decline events, including repeated declines of the same Step
292
+ dispatch while Dex retries it. Read its rate to assess reserve pressure. It never
293
+ resets and remains available after shutdown.
294
+ Listening Workers return zero.
287
295
 
288
296
  ### Canceling Step executions
289
297
 
@@ -637,6 +645,9 @@ reads (`describeFlow`, `waitForFlow`, and `timeTravel`) use
637
645
  `FlowNotActiveOrNotFoundError`. Start conflicts, worker failures, RPC lock contention,
638
646
  and long-poll timeouts use `FlowAlreadyStartedError`,
639
647
  `WorkerInvocationError`, `RpcLockConflictError`, and `LongPollTimeoutError`.
648
+ An update-class request rejected during Flow close cleanup uses
649
+ `FlowClosingError` with sub-status `FLOW_CLOSING`. Re-read the retained terminal
650
+ Flow state before deciding whether another action is needed.
640
651
 
641
652
  RPCs also use this error when the target Flow cannot be found, including query-only
642
653
  reads. A query-only RPC without locks, transactional execution, durable effects, or
@@ -18,6 +18,8 @@ export declare const ErrorSubStatus: Readonly<{
18
18
  readonly CHANNEL_MESSAGE_NOT_FOUND: "channelMessageNotFound";
19
19
  /** A caller-defined request budget expired. */
20
20
  readonly REQUEST_TIMEOUT: "requestTimeout";
21
+ /** Dex rejected an update-class request during Flow close cleanup. */
22
+ readonly FLOW_CLOSING: "flowClosing";
21
23
  }>;
22
24
  /** Represents a value from {@link ErrorSubStatus}. */
23
25
  export type ErrorSubStatus = (typeof ErrorSubStatus)[keyof typeof ErrorSubStatus];
@@ -59,6 +61,25 @@ export declare class DexServiceError extends Error {
59
61
  /** Indicates that `startFlow` conflicts with an existing Flow ID. */
60
62
  export declare class FlowAlreadyStartedError extends DexServiceError {
61
63
  }
64
+ /**
65
+ * Reports a request rejected while Dex closes a Flow.
66
+ * Re-read the retained terminal Flow state before deciding what to do next.
67
+ * @example
68
+ * ```typescript
69
+ * const options = { requestTimeoutMs: timeoutMs };
70
+ * try {
71
+ * await client.waitForStepCompletion(flowId, stepExecutionId, options);
72
+ * } catch (error) {
73
+ * if (error instanceof FlowClosingError) {
74
+ * await client.waitForFlow(flowId);
75
+ * } else {
76
+ * throw error;
77
+ * }
78
+ * }
79
+ * ```
80
+ */
81
+ export declare class FlowClosingError extends DexServiceError {
82
+ }
62
83
  /** Indicates that an operation targeted a Flow ID that does not exist. */
63
84
  export declare class FlowNotFoundError extends DexServiceError {
64
85
  }
@@ -24,6 +24,8 @@ export const ErrorSubStatus = Object.freeze({
24
24
  CHANNEL_MESSAGE_NOT_FOUND: "channelMessageNotFound",
25
25
  /** A caller-defined request budget expired. */
26
26
  REQUEST_TIMEOUT: "requestTimeout",
27
+ /** Dex rejected an update-class request during Flow close cleanup. */
28
+ FLOW_CLOSING: "flowClosing",
27
29
  });
28
30
  /** Provides terminal Flow failure categories returned by Dex. */
29
31
  export const FlowErrorType = Object.freeze({
@@ -69,6 +71,25 @@ export class DexServiceError extends Error {
69
71
  /** Indicates that `startFlow` conflicts with an existing Flow ID. */
70
72
  export class FlowAlreadyStartedError extends DexServiceError {
71
73
  }
74
+ /**
75
+ * Reports a request rejected while Dex closes a Flow.
76
+ * Re-read the retained terminal Flow state before deciding what to do next.
77
+ * @example
78
+ * ```typescript
79
+ * const options = { requestTimeoutMs: timeoutMs };
80
+ * try {
81
+ * await client.waitForStepCompletion(flowId, stepExecutionId, options);
82
+ * } catch (error) {
83
+ * if (error instanceof FlowClosingError) {
84
+ * await client.waitForFlow(flowId);
85
+ * } else {
86
+ * throw error;
87
+ * }
88
+ * }
89
+ * ```
90
+ */
91
+ export class FlowClosingError extends DexServiceError {
92
+ }
72
93
  /** Indicates that an operation targeted a Flow ID that does not exist. */
73
94
  export class FlowNotFoundError extends DexServiceError {
74
95
  }
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,kDAAkD;AAClD,mEAAmE;AACnE,+CAA+C;AAC/C,EAAE;AACF,0DAA0D;AAK1D,mFAAmF;AACnF,MAAM,OAAO,wBAAyB,SAAQ,KAAK;CAAG;AAEtD,6EAA6E;AAC7E,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,oDAAoD;IACpD,aAAa,EAAE,eAAe;IAC9B,2DAA2D;IAC3D,oBAAoB,EAAE,oBAAoB;IAC1C,2CAA2C;IAC3C,eAAe,EAAE,eAAe;IAChC,qDAAqD;IACrD,gBAAgB,EAAE,gBAAgB;IAClC,mEAAmE;IACnE,iBAAiB,EA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AAS,CAAC,CAAC,CAAC,eAAe,QAAQ,EAAE,CAAC,CAAC,CAAC,QAAQ,QAAQ,SAAS,QAAQ,EAAE,CAAC;QACxG,KAAK,CAAC,GAAG,MAAM,IAAI,MAAM,gCAAgC,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;QAP5D,aAAQ,GAAR,QAAQ,CAAQ;QAChB,aAAQ,GAAR,QAAQ,CAAoB;QAC5B,WAAM,GAAN,MAAM,CAA+B;IAMvD,CAAC;CACF;AAED,6EAA6E;AAC7E,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAQxB;IAPlB;;;;;OAKG;IACH,YACkB,SAA0C,EAC1D,MAAc,EACd,OAAsB;QAEtB,KAAK,CAAC,UAAU,SAAS,eAAe,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;QAJ3C,cAAS,GAAT,SAAS,CAAiC;QAK1D,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;IAC9B,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,SAAiB;IAC1C,OAAO,IAAI,wBAAwB,CAAC,GAAG,SAAS,2BAA2B,CAAC,CAAC;AAC/E,CAAC"}
@@ -36,7 +36,7 @@ export declare enum PollWorkerTaskRejectReason {
36
36
  }
37
37
  /**
38
38
  * Distinguishes no available Worker, a disconnected Worker, and a missing Step or RPC registration.
39
- * Go Server internals; server-zd does not serve or persist them.
39
+ * Go persists; server-zd does not.
40
40
  */
41
41
  export declare enum DispatchTaskErrorReason {
42
42
  DISPATCH_TASK_ERROR_REASON_UNSPECIFIED = 0,
@@ -195,6 +195,8 @@ export declare enum ErrorSubStatus {
195
195
  ERROR_SUB_STATUS_LONG_POLL_TIME_OUT = 5,
196
196
  ERROR_SUB_STATUS_CHANNEL_MESSAGE_NOT_FOUND = 6,
197
197
  ERROR_SUB_STATUS_REQUEST_TIMEOUT = 7,
198
+ /** ERROR_SUB_STATUS_FLOW_CLOSING - An update-class request arrived while Flow close cleanup is in progress. */
199
+ ERROR_SUB_STATUS_FLOW_CLOSING = 8,
198
200
  UNRECOGNIZED = -1
199
201
  }
200
202
  export declare enum CloseDecisionType {
@@ -479,6 +481,8 @@ export interface DispatchTaskResponse {
479
481
  servedByAppWorkerId: string;
480
482
  /** Identifies a Worker that rejected the task's Step type or RPC name. */
481
483
  rejectedByAppWorkerId: string;
484
+ /** Actual queue served; absent on older matching nodes, so consumers may infer it from Worker IDs. */
485
+ queueSource: PullRoutingSource;
482
486
  }
483
487
  /**
484
488
  * Reports a failure before Dex receives a Worker result.
@@ -1291,6 +1295,7 @@ export interface ServiceErrorResponse {
1291
1295
  originalWorkerErrorType: string;
1292
1296
  originalWorkerErrorStatus: number;
1293
1297
  originalWorkerErrorStackTrace: string;
1298
+ dispatchTaskErrorReason: DispatchTaskErrorReason;
1294
1299
  }
1295
1300
  export interface WorkerErrorResponse {
1296
1301
  detail: string;
@@ -1305,6 +1310,7 @@ export interface InternalActivityError {
1305
1310
  workerGrpcStatus: number;
1306
1311
  workerError: InternalWorkerError | undefined;
1307
1312
  pullRouting: PullRouting | undefined;
1313
+ dispatchTaskErrorReason: DispatchTaskErrorReason;
1308
1314
  }
1309
1315
  export interface InternalWorkerError {
1310
1316
  detail: string;
@@ -44,7 +44,7 @@ export var PollWorkerTaskRejectReason;
44
44
  })(PollWorkerTaskRejectReason || (PollWorkerTaskRejectReason = {}));
45
45
  /**
46
46
  * Distinguishes no available Worker, a disconnected Worker, and a missing Step or RPC registration.
47
- * Go Server internals; server-zd does not serve or persist them.
47
+ * Go persists; server-zd does not.
48
48
  */
49
49
  export var DispatchTaskErrorReason;
50
50
  (function (DispatchTaskErrorReason) {
@@ -221,6 +221,8 @@ export var ErrorSubStatus;
221
221
  ErrorSubStatus[ErrorSubStatus["ERROR_SUB_STATUS_LONG_POLL_TIME_OUT"] = 5] = "ERROR_SUB_STATUS_LONG_POLL_TIME_OUT";
222
222
  ErrorSubStatus[ErrorSubStatus["ERROR_SUB_STATUS_CHANNEL_MESSAGE_NOT_FOUND"] = 6] = "ERROR_SUB_STATUS_CHANNEL_MESSAGE_NOT_FOUND";
223
223
  ErrorSubStatus[ErrorSubStatus["ERROR_SUB_STATUS_REQUEST_TIMEOUT"] = 7] = "ERROR_SUB_STATUS_REQUEST_TIMEOUT";
224
+ /** ERROR_SUB_STATUS_FLOW_CLOSING - An update-class request arrived while Flow close cleanup is in progress. */
225
+ ErrorSubStatus[ErrorSubStatus["ERROR_SUB_STATUS_FLOW_CLOSING"] = 8] = "ERROR_SUB_STATUS_FLOW_CLOSING";
224
226
  ErrorSubStatus[ErrorSubStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
225
227
  })(ErrorSubStatus || (ErrorSubStatus = {}));
226
228
  export var CloseDecisionType;
@@ -1335,7 +1337,7 @@ export const DispatchTaskRequest = {
1335
1337
  },
1336
1338
  };
1337
1339
  function createBaseDispatchTaskResponse() {
1338
- return { output: undefined, servedByAppWorkerId: "", rejectedByAppWorkerId: "" };
1340
+ return { output: undefined, servedByAppWorkerId: "", rejectedByAppWorkerId: "", queueSource: 0 };
1339
1341
  }
1340
1342
  export const DispatchTaskResponse = {
1341
1343
  encode(message, writer = new BinaryWriter()) {
@@ -1368,6 +1370,9 @@ export const DispatchTaskResponse = {
1368
1370
  if (message.rejectedByAppWorkerId !== "") {
1369
1371
  writer.uint32(74).string(message.rejectedByAppWorkerId);
1370
1372
  }
1373
+ if (message.queueSource !== 0) {
1374
+ writer.uint32(80).int32(message.queueSource);
1375
+ }
1371
1376
  return writer;
1372
1377
  },
1373
1378
  decode(input, length) {
@@ -1440,6 +1445,13 @@ export const DispatchTaskResponse = {
1440
1445
  message.rejectedByAppWorkerId = reader.string();
1441
1446
  continue;
1442
1447
  }
1448
+ case 10: {
1449
+ if (tag !== 80) {
1450
+ break;
1451
+ }
1452
+ message.queueSource = reader.int32();
1453
+ continue;
1454
+ }
1443
1455
  }
1444
1456
  if ((tag & 7) === 4 || tag === 0) {
1445
1457
  break;
@@ -1499,6 +1511,7 @@ export const DispatchTaskResponse = {
1499
1511
  }
1500
1512
  message.servedByAppWorkerId = object.servedByAppWorkerId ?? "";
1501
1513
  message.rejectedByAppWorkerId = object.rejectedByAppWorkerId ?? "";
1514
+ message.queueSource = object.queueSource ?? 0;
1502
1515
  return message;
1503
1516
  },
1504
1517
  };
@@ -9718,6 +9731,7 @@ function createBaseServiceErrorResponse() {
9718
9731
  originalWorkerErrorType: "",
9719
9732
  originalWorkerErrorStatus: 0,
9720
9733
  originalWorkerErrorStackTrace: "",
9734
+ dispatchTaskErrorReason: 0,
9721
9735
  };
9722
9736
  }
9723
9737
  export const ServiceErrorResponse = {
@@ -9740,6 +9754,9 @@ export const ServiceErrorResponse = {
9740
9754
  if (message.originalWorkerErrorStackTrace !== "") {
9741
9755
  writer.uint32(50).string(message.originalWorkerErrorStackTrace);
9742
9756
  }
9757
+ if (message.dispatchTaskErrorReason !== 0) {
9758
+ writer.uint32(56).int32(message.dispatchTaskErrorReason);
9759
+ }
9743
9760
  return writer;
9744
9761
  },
9745
9762
  decode(input, length) {
@@ -9791,6 +9808,13 @@ export const ServiceErrorResponse = {
9791
9808
  message.originalWorkerErrorStackTrace = reader.string();
9792
9809
  continue;
9793
9810
  }
9811
+ case 7: {
9812
+ if (tag !== 56) {
9813
+ break;
9814
+ }
9815
+ message.dispatchTaskErrorReason = reader.int32();
9816
+ continue;
9817
+ }
9794
9818
  }
9795
9819
  if ((tag & 7) === 4 || tag === 0) {
9796
9820
  break;
@@ -9810,6 +9834,7 @@ export const ServiceErrorResponse = {
9810
9834
  message.originalWorkerErrorType = object.originalWorkerErrorType ?? "";
9811
9835
  message.originalWorkerErrorStatus = object.originalWorkerErrorStatus ?? 0;
9812
9836
  message.originalWorkerErrorStackTrace = object.originalWorkerErrorStackTrace ?? "";
9837
+ message.dispatchTaskErrorReason = object.dispatchTaskErrorReason ?? 0;
9813
9838
  return message;
9814
9839
  },
9815
9840
  };
@@ -9899,7 +9924,13 @@ export const WorkerErrorResponse = {
9899
9924
  },
9900
9925
  };
9901
9926
  function createBaseInternalActivityError() {
9902
- return { serverDetail: "", workerGrpcStatus: 0, workerError: undefined, pullRouting: undefined };
9927
+ return {
9928
+ serverDetail: "",
9929
+ workerGrpcStatus: 0,
9930
+ workerError: undefined,
9931
+ pullRouting: undefined,
9932
+ dispatchTaskErrorReason: 0,
9933
+ };
9903
9934
  }
9904
9935
  export const InternalActivityError = {
9905
9936
  encode(message, writer = new BinaryWriter()) {
@@ -9915,6 +9946,9 @@ export const InternalActivityError = {
9915
9946
  if (message.pullRouting !== undefined) {
9916
9947
  PullRouting.encode(message.pullRouting, writer.uint32(34).fork()).join();
9917
9948
  }
9949
+ if (message.dispatchTaskErrorReason !== 0) {
9950
+ writer.uint32(40).int32(message.dispatchTaskErrorReason);
9951
+ }
9918
9952
  return writer;
9919
9953
  },
9920
9954
  decode(input, length) {
@@ -9952,6 +9986,13 @@ export const InternalActivityError = {
9952
9986
  message.pullRouting = PullRouting.decode(reader, reader.uint32());
9953
9987
  continue;
9954
9988
  }
9989
+ case 5: {
9990
+ if (tag !== 40) {
9991
+ break;
9992
+ }
9993
+ message.dispatchTaskErrorReason = reader.int32();
9994
+ continue;
9995
+ }
9955
9996
  }
9956
9997
  if ((tag & 7) === 4 || tag === 0) {
9957
9998
  break;
@@ -9973,6 +10014,7 @@ export const InternalActivityError = {
9973
10014
  message.pullRouting = (object.pullRouting !== undefined && object.pullRouting !== null)
9974
10015
  ? PullRouting.fromPartial(object.pullRouting)
9975
10016
  : undefined;
10017
+ message.dispatchTaskErrorReason = object.dispatchTaskErrorReason ?? 0;
9976
10018
  return message;
9977
10019
  },
9978
10020
  };