@dudousxd/nestjs-durable-core 0.105.0 → 0.106.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/dist/index.cjs +187 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +78 -2
- package/dist/index.d.ts +78 -2
- package/dist/index.js +187 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3496,6 +3496,11 @@ var RemoteWorkflowExecutor = class {
|
|
|
3496
3496
|
};
|
|
3497
3497
|
await this.transport.dispatchWorkflowTask(task);
|
|
3498
3498
|
}
|
|
3499
|
+
/** Where the broker has the task dispatched under `taskId`, when the transport can tell. */
|
|
3500
|
+
async taskState(_run, taskId) {
|
|
3501
|
+
if (!this.transport.workflowTaskState) return "unknown";
|
|
3502
|
+
return this.transport.workflowTaskState(tenantGroup(sanitizeQueueToken(this.name), this.partition), taskId);
|
|
3503
|
+
}
|
|
3499
3504
|
};
|
|
3500
3505
|
|
|
3501
3506
|
// src/run-dispatch-batcher.ts
|
|
@@ -7316,6 +7321,20 @@ function mergeTags(staticTags, runTags) {
|
|
|
7316
7321
|
}
|
|
7317
7322
|
__name(mergeTags, "mergeTags");
|
|
7318
7323
|
var BREAKPOINT = "breakpoint";
|
|
7324
|
+
var LOST_TURN_SUFFIX = ":lost";
|
|
7325
|
+
var GRACED_TURN_SUFFIX = ":grace";
|
|
7326
|
+
function awaitsDecision(run, decision) {
|
|
7327
|
+
const marker = run.awaitingDecisionTaskId;
|
|
7328
|
+
return marker !== void 0 && awaitedTaskId(marker) === decision.taskId;
|
|
7329
|
+
}
|
|
7330
|
+
__name(awaitsDecision, "awaitsDecision");
|
|
7331
|
+
function awaitedTaskId(marker) {
|
|
7332
|
+
let id = marker;
|
|
7333
|
+
if (id.endsWith(LOST_TURN_SUFFIX)) id = id.slice(0, -LOST_TURN_SUFFIX.length);
|
|
7334
|
+
if (id.endsWith(GRACED_TURN_SUFFIX)) id = id.slice(0, -GRACED_TURN_SUFFIX.length);
|
|
7335
|
+
return id;
|
|
7336
|
+
}
|
|
7337
|
+
__name(awaitedTaskId, "awaitedTaskId");
|
|
7319
7338
|
var PENDING_POLL_BATCH = 100;
|
|
7320
7339
|
var DEFAULT_STICKY_RUNS = 1e3;
|
|
7321
7340
|
var DEFAULT_STICKY_IDLE_MS = 3e5;
|
|
@@ -7585,6 +7604,9 @@ var WorkflowEngine = class _WorkflowEngine {
|
|
|
7585
7604
|
* `clock() + leaseMs`, so at or after it). See {@link orphanedRuns}.
|
|
7586
7605
|
*/
|
|
7587
7606
|
ownLeaseCutoffMs;
|
|
7607
|
+
/** When this engine was built (clock ms): {@link noteLapsedTurn} counts no lost turn within one
|
|
7608
|
+
* turn window of it, while live workers' beats catch up with deadlines that went stale. */
|
|
7609
|
+
bootedAtMs;
|
|
7588
7610
|
maxRecoveryAttempts;
|
|
7589
7611
|
unregisteredWorkflowGraceMs;
|
|
7590
7612
|
remoteAdvanceSilenceMs;
|
|
@@ -7814,6 +7836,7 @@ var WorkflowEngine = class _WorkflowEngine {
|
|
|
7814
7836
|
this.namespace = poolNamespace(deps.namespace);
|
|
7815
7837
|
this.leaseMs = deps.leaseMs ?? 3e4;
|
|
7816
7838
|
this.ownLeaseCutoffMs = this.clock() + this.leaseMs;
|
|
7839
|
+
this.bootedAtMs = this.clock();
|
|
7817
7840
|
this.maxRecoveryAttempts = deps.maxRecoveryAttempts;
|
|
7818
7841
|
const grace = deps.unregisteredWorkflowGraceMs;
|
|
7819
7842
|
this.unregisteredWorkflowGraceMs = grace !== void 0 && Number.isFinite(grace) && grace >= 0 ? grace : 24 * 60 * 60 * 1e3;
|
|
@@ -8191,6 +8214,9 @@ var WorkflowEngine = class _WorkflowEngine {
|
|
|
8191
8214
|
return;
|
|
8192
8215
|
}
|
|
8193
8216
|
if (dispatch.reason !== "wake" || TERMINAL_RUN_STATUSES.includes(run.status)) return;
|
|
8217
|
+
if (dispatch.awaiting !== void 0 && (run.awaitingDecisionTaskId === void 0 || awaitedTaskId(run.awaitingDecisionTaskId) !== dispatch.awaiting)) {
|
|
8218
|
+
return;
|
|
8219
|
+
}
|
|
8194
8220
|
const nowMs = this.clock();
|
|
8195
8221
|
if (run.wakeAt !== void 0 && run.wakeAt <= nowMs) {
|
|
8196
8222
|
const waiters = indexWaitersByRun(await listSignalWaitersOfRuns(this.store, [
|
|
@@ -8242,6 +8268,7 @@ var WorkflowEngine = class _WorkflowEngine {
|
|
|
8242
8268
|
*/
|
|
8243
8269
|
async handOffDue(runs, nowMs, settled) {
|
|
8244
8270
|
const claimed = [];
|
|
8271
|
+
const awaiting = /* @__PURE__ */ new Map();
|
|
8245
8272
|
for (const run of runs) {
|
|
8246
8273
|
if (this.draining) break;
|
|
8247
8274
|
this.markClaim(run.id);
|
|
@@ -8256,16 +8283,26 @@ var WorkflowEngine = class _WorkflowEngine {
|
|
|
8256
8283
|
continue;
|
|
8257
8284
|
}
|
|
8258
8285
|
try {
|
|
8286
|
+
const seen = {};
|
|
8287
|
+
const handled = await this.noteLapsedTurn(run.id, nowMs, seen);
|
|
8288
|
+
if (handled) {
|
|
8289
|
+
if (handled.status === "dead") settled?.set(run.id, handled);
|
|
8290
|
+
continue;
|
|
8291
|
+
}
|
|
8259
8292
|
const patch = {
|
|
8260
8293
|
wakeAt: nowMs + this.leaseMs
|
|
8261
8294
|
};
|
|
8295
|
+
let won = true;
|
|
8262
8296
|
if (this.store.updateRunIf) {
|
|
8263
|
-
|
|
8297
|
+
won = await this.store.updateRunIf(run.id, [
|
|
8264
8298
|
run.status
|
|
8265
|
-
], patch)
|
|
8299
|
+
], patch);
|
|
8266
8300
|
} else {
|
|
8267
8301
|
await this.store.updateRun(run.id, patch);
|
|
8302
|
+
}
|
|
8303
|
+
if (won) {
|
|
8268
8304
|
claimed.push(run);
|
|
8305
|
+
if (seen.marker !== void 0) awaiting.set(run.id, awaitedTaskId(seen.marker));
|
|
8269
8306
|
}
|
|
8270
8307
|
} finally {
|
|
8271
8308
|
await this.store.releaseRunLock(run.id, this.instanceId);
|
|
@@ -8276,13 +8313,19 @@ var WorkflowEngine = class _WorkflowEngine {
|
|
|
8276
8313
|
}
|
|
8277
8314
|
try {
|
|
8278
8315
|
for (let at = 0; at < claimed.length; at += RUN_DISPATCH_BATCH) {
|
|
8279
|
-
await this.pool.dispatchRuns(claimed.slice(at, at + RUN_DISPATCH_BATCH).map((run) =>
|
|
8280
|
-
|
|
8281
|
-
|
|
8282
|
-
|
|
8283
|
-
|
|
8284
|
-
|
|
8285
|
-
|
|
8316
|
+
await this.pool.dispatchRuns(claimed.slice(at, at + RUN_DISPATCH_BATCH).map((run) => {
|
|
8317
|
+
const turn = awaiting.get(run.id);
|
|
8318
|
+
return {
|
|
8319
|
+
runId: run.id,
|
|
8320
|
+
reason: "wake",
|
|
8321
|
+
...run.priority !== void 0 ? {
|
|
8322
|
+
priority: run.priority
|
|
8323
|
+
} : {},
|
|
8324
|
+
...turn !== void 0 ? {
|
|
8325
|
+
awaiting: turn
|
|
8326
|
+
} : {}
|
|
8327
|
+
};
|
|
8328
|
+
}), {
|
|
8286
8329
|
namespace: this.namespace
|
|
8287
8330
|
});
|
|
8288
8331
|
}
|
|
@@ -11356,28 +11399,39 @@ var WorkflowEngine = class _WorkflowEngine {
|
|
|
11356
11399
|
* `maxRecoveryAttempts` — move a poison pill to the `dead` dead-letter state. Returns a terminal
|
|
11357
11400
|
* result to skip the resume, or `undefined` to proceed.
|
|
11358
11401
|
*/
|
|
11359
|
-
async countRecovery(run) {
|
|
11402
|
+
async countRecovery(run, extra = {}) {
|
|
11360
11403
|
const attempts = (run.recoveryAttempts ?? 0) + 1;
|
|
11404
|
+
const updateIf = /* @__PURE__ */ __name((patch) => (this.store.updateRunIf ?? this.updateRunIfFallback).call(this.store, run.id, [
|
|
11405
|
+
run.status
|
|
11406
|
+
], patch), "updateIf");
|
|
11407
|
+
const moved = /* @__PURE__ */ __name(async () => {
|
|
11408
|
+
await this.store.releaseRunLock(run.id);
|
|
11409
|
+
return this.echoCurrentStatus(run.id);
|
|
11410
|
+
}, "moved");
|
|
11361
11411
|
if (this.maxRecoveryAttempts != null && attempts > this.maxRecoveryAttempts) {
|
|
11362
11412
|
const error2 = {
|
|
11363
11413
|
message: `run exceeded maxRecoveryAttempts (${this.maxRecoveryAttempts}) \u2014 moved to dead-letter`,
|
|
11364
11414
|
code: "max_recovery_attempts"
|
|
11365
11415
|
};
|
|
11366
|
-
await
|
|
11416
|
+
const written = await updateIf(await this.withLifecycleMarker(run, {
|
|
11367
11417
|
status: "dead",
|
|
11368
11418
|
error: error2,
|
|
11369
11419
|
updatedAt: /* @__PURE__ */ new Date()
|
|
11370
11420
|
}));
|
|
11421
|
+
if (!written) return moved();
|
|
11371
11422
|
await this.store.releaseRunLock(run.id);
|
|
11372
11423
|
return this.announceDead({
|
|
11373
11424
|
...run,
|
|
11374
11425
|
recoveryAttempts: attempts
|
|
11375
11426
|
}, error2);
|
|
11376
11427
|
}
|
|
11377
|
-
await
|
|
11428
|
+
if (!await updateIf({
|
|
11429
|
+
...extra,
|
|
11378
11430
|
recoveryAttempts: attempts,
|
|
11379
11431
|
updatedAt: /* @__PURE__ */ new Date()
|
|
11380
|
-
})
|
|
11432
|
+
})) {
|
|
11433
|
+
return moved();
|
|
11434
|
+
}
|
|
11381
11435
|
return void 0;
|
|
11382
11436
|
}
|
|
11383
11437
|
/** Tell everyone a run was just written `dead`: events, dead-letter routing, a waiting parent. */
|
|
@@ -11524,7 +11578,87 @@ var WorkflowEngine = class _WorkflowEngine {
|
|
|
11524
11578
|
return this.resumeLeased([
|
|
11525
11579
|
...due,
|
|
11526
11580
|
...blocked
|
|
11527
|
-
], nowMs, (run) => this.reconcileSignalWaiter(run, waiterByRun.get(run.id)));
|
|
11581
|
+
], nowMs, async (run) => await this.noteLapsedTurn(run.id, nowMs) ?? this.reconcileSignalWaiter(run, waiterByRun.get(run.id)));
|
|
11582
|
+
}
|
|
11583
|
+
/**
|
|
11584
|
+
* Called under the run's lease by the due-timer pass, for a run that THIS instance would re-drive.
|
|
11585
|
+
* A run suspended awaiting a DISPATCHED workflow turn's decision (`awaitingDecisionTaskId`) whose
|
|
11586
|
+
* re-drive deadline (`wakeAt`) has passed lost that turn: no decision came back and the worker
|
|
11587
|
+
* stopped beating (every beat pushes `wakeAt` forward, see {@link rearmDecisionDeadline}), so the
|
|
11588
|
+
* worker running it died, or the task was lost with it. That is the dispatched form of a crashed
|
|
11589
|
+
* inline turn, so it spends the same {@link maxRecoveryAttempts} budget through
|
|
11590
|
+
* {@link countRecovery}: a turn that keeps killing its worker ends `dead` (with the same
|
|
11591
|
+
* `run.failed` announcement) instead of being re-dispatched, and redelivered, for ever.
|
|
11592
|
+
*
|
|
11593
|
+
* Counted at most once per awaited turn: the count rewrites the marker to its `:lost` form, which
|
|
11594
|
+
* no later pass counts again however long the re-drive waits on the run queue, and the re-drive's
|
|
11595
|
+
* dispatch replaces it with the next turn's id. Not counted, and the re-drive left for later:
|
|
11596
|
+
* - while the broker still holds the task unstarted (a backed-up queue, not a dead worker), or
|
|
11597
|
+
* - within one turn window of this engine's boot, when beats from live workers have not yet had
|
|
11598
|
+
* the chance to push a deadline that went stale while the engine was down. Once per turn (the
|
|
11599
|
+
* `:grace` marker): a lapse after that takes the normal path, whichever instance judges it.
|
|
11600
|
+
* A late decision of a counted turn is still applied while the re-drive has not dispatched yet
|
|
11601
|
+
* (see `awaitsDecision`), and gives the attempt back.
|
|
11602
|
+
* Never counted by an instance that cannot resolve the workflow (it re-drives nothing), nor for a
|
|
11603
|
+
* decision that arrives, a worker that keeps beating, or any write a healthy turn makes on its way.
|
|
11604
|
+
*
|
|
11605
|
+
* Re-reads under the lease: the listing may predate a decision applied since. Returns a result when
|
|
11606
|
+
* the run was dead-lettered or left waiting (the lease released either way), else `undefined` for
|
|
11607
|
+
* the caller to re-drive as before. A decision that lands while this holds the lease is dropped (it
|
|
11608
|
+
* cannot take the lease), whichever way this pass goes: with a run it dead-letters, or with one it
|
|
11609
|
+
* graces or leaves waiting on a `queued` task, whose next lapse then counts the turn and runs it
|
|
11610
|
+
* again. A narrow race, accepted.
|
|
11611
|
+
*
|
|
11612
|
+
* The marker grows by up to 11 characters (`:grace:lost`) beyond the dispatched id, which is
|
|
11613
|
+
* `<runId>:wf:<8 hex>`: `runId` plus 23 in all. A store that bounds the column (TypeORM's
|
|
11614
|
+
* `varchar(191)`) therefore dispatches a run whose id is 169 to 179 characters long, then refuses
|
|
11615
|
+
* the grace or lost write for it.
|
|
11616
|
+
*/
|
|
11617
|
+
async noteLapsedTurn(runId, nowMs, seen) {
|
|
11618
|
+
const run = await this.store.getRun(runId);
|
|
11619
|
+
const awaited = run?.awaitingDecisionTaskId;
|
|
11620
|
+
if (seen) seen.marker = awaited;
|
|
11621
|
+
if (!run || run.status !== "suspended" || awaited === void 0 || awaited.endsWith(LOST_TURN_SUFFIX) || run.wakeAt == null || run.wakeAt > nowMs) {
|
|
11622
|
+
return void 0;
|
|
11623
|
+
}
|
|
11624
|
+
if (!this.isRegisteredHere(run) && !await this.canResolveWorkflow(run)) return void 0;
|
|
11625
|
+
const windowMs = this.dispatchedTurnSilenceMs;
|
|
11626
|
+
if (windowMs != null && nowMs < this.bootedAtMs + windowMs && !awaited.endsWith(GRACED_TURN_SUFFIX)) {
|
|
11627
|
+
return this.leaveTurnWaiting(run, this.bootedAtMs + windowMs, {
|
|
11628
|
+
awaitingDecisionTaskId: `${awaited}${GRACED_TURN_SUFFIX}`
|
|
11629
|
+
});
|
|
11630
|
+
}
|
|
11631
|
+
const state = await this.dispatchedTurnState(run, awaitedTaskId(awaited));
|
|
11632
|
+
if (state === "queued") return this.leaveTurnWaiting(run, nowMs + (windowMs ?? this.leaseMs));
|
|
11633
|
+
if (state === "error") return void 0;
|
|
11634
|
+
return this.countRecovery(run, {
|
|
11635
|
+
awaitingDecisionTaskId: `${awaited}${LOST_TURN_SUFFIX}`
|
|
11636
|
+
});
|
|
11637
|
+
}
|
|
11638
|
+
/** Where the broker has the task of a dispatched turn: see {@link WorkflowExecutor.taskState}. */
|
|
11639
|
+
async dispatchedTurnState(run, taskId) {
|
|
11640
|
+
const executor = (this.workflows.get(versionKey(run.workflow, run.workflowVersion)) ?? this.latest.get(run.workflow))?.remote?.executor;
|
|
11641
|
+
if (!executor?.taskState) return "unknown";
|
|
11642
|
+
try {
|
|
11643
|
+
return await executor.taskState(run, taskId);
|
|
11644
|
+
} catch {
|
|
11645
|
+
return "error";
|
|
11646
|
+
}
|
|
11647
|
+
}
|
|
11648
|
+
/** Push a lapsed turn's deadline to `until` without re-driving it, and give the lease back. */
|
|
11649
|
+
async leaveTurnWaiting(run, until, extra = {}) {
|
|
11650
|
+
await (this.store.updateRunIf ?? this.updateRunIfFallback).call(this.store, run.id, [
|
|
11651
|
+
"suspended"
|
|
11652
|
+
], {
|
|
11653
|
+
...extra,
|
|
11654
|
+
wakeAt: until,
|
|
11655
|
+
updatedAt: /* @__PURE__ */ new Date()
|
|
11656
|
+
});
|
|
11657
|
+
await this.store.releaseRunLock(run.id);
|
|
11658
|
+
return {
|
|
11659
|
+
runId: run.id,
|
|
11660
|
+
status: "suspended"
|
|
11661
|
+
};
|
|
11528
11662
|
}
|
|
11529
11663
|
/**
|
|
11530
11664
|
* The reconcile safety net's per-run check (see {@link resumeDueTimers}): if this suspended run has
|
|
@@ -13826,6 +13960,12 @@ ${run.workflowVersion}`;
|
|
|
13826
13960
|
const applied = await (this.store.updateRunIf ?? this.updateRunIfFallback).call(this.store, run.id, SUSPEND_ELIGIBLE_STATUSES, await this.withRunTrace(run, {
|
|
13827
13961
|
status: "suspended",
|
|
13828
13962
|
wakeAt: this.reconcileWakeAt(outcome.wakeAt),
|
|
13963
|
+
// A turn that ran here suspended the run, so no dispatched turn is awaited any more: a marker
|
|
13964
|
+
// left by an earlier dispatch (a re-drive that followed an onError handoff, say) would make
|
|
13965
|
+
// this suspend read as a lost turn at its next reconcile wake.
|
|
13966
|
+
...run.awaitingDecisionTaskId !== void 0 ? {
|
|
13967
|
+
awaitingDecisionTaskId: void 0
|
|
13968
|
+
} : {},
|
|
13829
13969
|
updatedAt: stamp
|
|
13830
13970
|
}));
|
|
13831
13971
|
if (!applied) return this.echoCurrentStatus(run.id);
|
|
@@ -16648,7 +16788,7 @@ ${run.workflowVersion}`;
|
|
|
16648
16788
|
*/
|
|
16649
16789
|
async completeRemoteDecision(decision) {
|
|
16650
16790
|
const run = await this.store.getRun(decision.runId);
|
|
16651
|
-
if (!run || run
|
|
16791
|
+
if (!run || !awaitsDecision(run, decision)) return;
|
|
16652
16792
|
if (run.status === "cancelled" || run.status === "completed" || run.status === "dead") return;
|
|
16653
16793
|
if (this.namespace !== void 0 && run.namespace !== void 0 && poolNamespace(run.namespace) !== this.namespace) {
|
|
16654
16794
|
return;
|
|
@@ -16660,16 +16800,20 @@ ${run.workflowVersion}`;
|
|
|
16660
16800
|
const held = this.holdExecutionLease(decision.runId);
|
|
16661
16801
|
try {
|
|
16662
16802
|
const fresh = await this.store.getRun(decision.runId);
|
|
16663
|
-
if (!fresh || fresh
|
|
16803
|
+
if (!fresh || !awaitsDecision(fresh, decision)) return;
|
|
16664
16804
|
if (fresh.status === "cancelled" || fresh.status === "completed" || fresh.status === "dead") {
|
|
16665
16805
|
return;
|
|
16666
16806
|
}
|
|
16667
16807
|
await this.store.updateRun(decision.runId, {
|
|
16668
16808
|
awaitingDecisionTaskId: void 0,
|
|
16669
16809
|
wakeAt: void 0,
|
|
16810
|
+
...fresh.recoveryAttempts ? {
|
|
16811
|
+
recoveryAttempts: 0
|
|
16812
|
+
} : {},
|
|
16670
16813
|
updatedAt: /* @__PURE__ */ new Date()
|
|
16671
16814
|
});
|
|
16672
16815
|
fresh.awaitingDecisionTaskId = void 0;
|
|
16816
|
+
if (fresh.recoveryAttempts) fresh.recoveryAttempts = 0;
|
|
16673
16817
|
await this.applyDecision(fresh, decision);
|
|
16674
16818
|
} finally {
|
|
16675
16819
|
const fenced = held.lease.lost;
|
|
@@ -16705,6 +16849,9 @@ ${run.workflowVersion}`;
|
|
|
16705
16849
|
this.decisionDeadlineRearms.delete(runId);
|
|
16706
16850
|
return;
|
|
16707
16851
|
}
|
|
16852
|
+
if (run.awaitingDecisionTaskId.endsWith(GRACED_TURN_SUFFIX) && !await this.clearTurnGrace(runId, run.awaitingDecisionTaskId, now)) {
|
|
16853
|
+
return;
|
|
16854
|
+
}
|
|
16708
16855
|
const halfWindow = Math.ceil(silenceMs / 2);
|
|
16709
16856
|
if (run.wakeAt != null && run.wakeAt > now + halfWindow) {
|
|
16710
16857
|
this.decisionDeadlineRearms.set(runId, run.wakeAt - halfWindow);
|
|
@@ -16721,6 +16868,29 @@ ${run.workflowVersion}`;
|
|
|
16721
16868
|
}
|
|
16722
16869
|
}
|
|
16723
16870
|
/**
|
|
16871
|
+
* Write a graced turn's marker back to its bare task id (see {@link GRACED_TURN_SUFFIX}), under the
|
|
16872
|
+
* run's lease and only while the marker is still `marker`: a decision and a re-dispatch both write
|
|
16873
|
+
* the marker under that lease, so this never puts back the id of a turn they already replaced.
|
|
16874
|
+
* False when the lease was busy or the write failed; the caller's next beat tries again.
|
|
16875
|
+
*/
|
|
16876
|
+
async clearTurnGrace(runId, marker, nowMs) {
|
|
16877
|
+
if (!await this.store.tryLockRun(runId, this.instanceId, nowMs + this.leaseMs, nowMs)) {
|
|
16878
|
+
return false;
|
|
16879
|
+
}
|
|
16880
|
+
try {
|
|
16881
|
+
const fresh = await this.store.getRun(runId);
|
|
16882
|
+
if (fresh?.awaitingDecisionTaskId === marker) {
|
|
16883
|
+
await this.store.updateRun(runId, {
|
|
16884
|
+
awaitingDecisionTaskId: marker.slice(0, -GRACED_TURN_SUFFIX.length),
|
|
16885
|
+
updatedAt: /* @__PURE__ */ new Date()
|
|
16886
|
+
});
|
|
16887
|
+
}
|
|
16888
|
+
return true;
|
|
16889
|
+
} finally {
|
|
16890
|
+
await this.store.releaseRunLock(runId);
|
|
16891
|
+
}
|
|
16892
|
+
}
|
|
16893
|
+
/**
|
|
16724
16894
|
* A slot freed on `queue` (a fleet-wide signal): resume this instance's runs blocked on it so they
|
|
16725
16895
|
* re-contend now instead of at their retry tick. Snapshot-and-clear — a run still blocked after the
|
|
16726
16896
|
* retry re-registers itself, and one that's gone (cancelled/admitted) is dropped. Best-effort.
|
|
@@ -19116,6 +19286,7 @@ var InMemoryRunQueue = class {
|
|
|
19116
19286
|
const waiting = lane.queued.get(run.runId);
|
|
19117
19287
|
if (waiting) {
|
|
19118
19288
|
if (run.reason === "wake") waiting.reason = "wake";
|
|
19289
|
+
if (waiting.awaiting !== run.awaiting) waiting.awaiting = void 0;
|
|
19119
19290
|
continue;
|
|
19120
19291
|
}
|
|
19121
19292
|
const entry = {
|