@indigoai-us/hq-cloud 6.18.44-alpha.0 → 6.18.44-alpha.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/dist/bin/sync-runner-watch-loop.d.ts +0 -39
- package/dist/bin/sync-runner-watch-loop.d.ts.map +1 -1
- package/dist/bin/sync-runner-watch-loop.js +14 -134
- package/dist/bin/sync-runner-watch-loop.js.map +1 -1
- package/dist/bin/sync-runner.test.js +1 -606
- package/dist/bin/sync-runner.test.js.map +1 -1
- package/dist/sync/push-receiver.d.ts.map +1 -1
- package/dist/sync/push-receiver.js +6 -11
- package/dist/sync/push-receiver.js.map +1 -1
- package/dist/sync/push-receiver.test.js +1 -56
- package/dist/sync/push-receiver.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -38,20 +38,6 @@ export declare const REALTIME_WORKER_OCCUPANCY_CAP = 2;
|
|
|
38
38
|
export declare const REALTIME_LARGE_UPLOAD_THRESHOLD_BYTES: number;
|
|
39
39
|
export declare function setRealtimeAdmissionDeadlineMsForTesting(ms: number | undefined): void;
|
|
40
40
|
export declare function setRealtimeDrainBurstMsForTesting(ms: number | undefined): void;
|
|
41
|
-
/**
|
|
42
|
-
* Retry delay for a watcher push or pull refused at the admission deadline.
|
|
43
|
-
* The refusal is a deferral, not a pass failure, so it does not advance the
|
|
44
|
-
* route's failure backoff. Each retry can wait up to the deadline again,
|
|
45
|
-
* so a long chore costs at most one attempt per deadline plus this delay.
|
|
46
|
-
*/
|
|
47
|
-
export declare const REALTIME_ADMISSION_RETRY_MS = 5000;
|
|
48
|
-
/**
|
|
49
|
-
* In-process result of a scoped drain whose only shortfall was admission
|
|
50
|
-
* deferrals: the paths are restored and a retry is scheduled. Never a
|
|
51
|
-
* process exit code (negative), so it cannot reach the menubar's exit
|
|
52
|
-
* handling, and it is not 0, so it does not count as a completed pass.
|
|
53
|
-
*/
|
|
54
|
-
export declare const SCOPED_DRAIN_DEFERRED = -1;
|
|
55
41
|
export declare class RealtimeAdmissionTimeoutError extends Error {
|
|
56
42
|
readonly retryable = true;
|
|
57
43
|
constructor(deadlineMs: number);
|
|
@@ -136,11 +122,6 @@ export declare class CooperativePassScheduler<T> {
|
|
|
136
122
|
});
|
|
137
123
|
get handoffActive(): boolean;
|
|
138
124
|
get hasActiveChore(): boolean;
|
|
139
|
-
/**
|
|
140
|
-
* A chore owns the slot, or has lent it through a checkpoint or network
|
|
141
|
-
* hand-off and will take it back. Hand-offs only ever start from a chore.
|
|
142
|
-
*/
|
|
143
|
-
private get choreHoldsSlot();
|
|
144
125
|
get hasActiveSlowRealtime(): boolean;
|
|
145
126
|
/** Includes the running slow/fast lanes and hand-off occupants; it never changes their cap. */
|
|
146
127
|
get activeRealtimeWorkerCount(): number;
|
|
@@ -150,26 +131,6 @@ export declare class CooperativePassScheduler<T> {
|
|
|
150
131
|
private abortedError;
|
|
151
132
|
/** Realtime stays ahead of a queued full chore so retries are not buried. */
|
|
152
133
|
private enqueuePending;
|
|
153
|
-
/**
|
|
154
|
-
* Bound how long a queued realtime entry sits behind a chore, counted from
|
|
155
|
-
* the first moment a chore holds the slot while it is queued. Time spent
|
|
156
|
-
* behind other realtime work does not count against it. Idempotent while
|
|
157
|
-
* the same chore holds the slot: an entry keeps its first deadline across
|
|
158
|
-
* that chore's hand-offs. Cleared when the chore finishes.
|
|
159
|
-
*/
|
|
160
|
-
private armAdmission;
|
|
161
|
-
/**
|
|
162
|
-
* A chore has taken (or taken back) the slot. Realtime queued while it
|
|
163
|
-
* was lent, or behind other realtime, would otherwise wait for the chore's
|
|
164
|
-
* next checkpoint with no bound.
|
|
165
|
-
*/
|
|
166
|
-
private armQueuedRealtime;
|
|
167
|
-
/**
|
|
168
|
-
* No chore holds the slot any more. Queued realtime now waits only behind
|
|
169
|
-
* other realtime, which does not count against the deadline; the next
|
|
170
|
-
* chore to take the slot arms a fresh one.
|
|
171
|
-
*/
|
|
172
|
-
private disarmQueuedRealtime;
|
|
173
134
|
private clearAdmission;
|
|
174
135
|
private dropPending;
|
|
175
136
|
private expireAdmission;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-runner-watch-loop.d.ts","sourceRoot":"","sources":["../../src/bin/sync-runner-watch-loop.ts"],"names":[],"mappings":"AAmCA,OAAO,EAML,KAAK,UAAU,EAEf,KAAK,eAAe,EACrB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAUL,WAAW,EAYZ,MAAM,eAAe,CAAC;AAevB,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAC;AASlC,OAAO,EACL,UAAU,EA0CX,MAAM,iCAAiC,CAAC;AAKzC,OAAO,EAEL,qBAAqB,EAEtB,MAAM,2BAA2B,CAAC;AAOnC,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEL,KAAK,eAAe,EAIrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAahD,OAAO,KAAK,EACV,yBAAyB,EACzB,SAAS,EAET,cAAc,EACd,iBAAiB,EAElB,MAAM,kBAAkB,CAAC;AAI1B,+EAA+E;AAC/E,eAAO,MAAM,mCAAmC,OAAQ,CAAC;AACzD,yEAAyE;AACzE,eAAO,MAAM,uBAAuB,QAAiB,CAAC;AACtD;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,QACI,CAAC;AAChD;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,QAAiC,CAAC;AACtE;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAC/C,+EAA+E;AAC/E,eAAO,MAAM,qCAAqC,QAA4B,CAAC;AAK/E,wBAAgB,wCAAwC,CACtD,EAAE,EAAE,MAAM,GAAG,SAAS,GACrB,IAAI,CAEN;AAED,wBAAgB,iCAAiC,CAC/C,EAAE,EA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,EAAE,MAAM,EAAE,EACd,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,CAgBjB;AAED,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EAAE,EACd,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,CAqoIjB"}
|
|
@@ -84,20 +84,6 @@ function realtimeAdmissionDeadlineMs() {
|
|
|
84
84
|
function realtimeDrainBurstMs() {
|
|
85
85
|
return realtimeDrainBurstMsForTest ?? REALTIME_DRAIN_BURST_MS;
|
|
86
86
|
}
|
|
87
|
-
/**
|
|
88
|
-
* Retry delay for a watcher push or pull refused at the admission deadline.
|
|
89
|
-
* The refusal is a deferral, not a pass failure, so it does not advance the
|
|
90
|
-
* route's failure backoff. Each retry can wait up to the deadline again,
|
|
91
|
-
* so a long chore costs at most one attempt per deadline plus this delay.
|
|
92
|
-
*/
|
|
93
|
-
export const REALTIME_ADMISSION_RETRY_MS = 5_000;
|
|
94
|
-
/**
|
|
95
|
-
* In-process result of a scoped drain whose only shortfall was admission
|
|
96
|
-
* deferrals: the paths are restored and a retry is scheduled. Never a
|
|
97
|
-
* process exit code (negative), so it cannot reach the menubar's exit
|
|
98
|
-
* handling, and it is not 0, so it does not count as a completed pass.
|
|
99
|
-
*/
|
|
100
|
-
export const SCOPED_DRAIN_DEFERRED = -1;
|
|
101
87
|
export class RealtimeAdmissionTimeoutError extends Error {
|
|
102
88
|
retryable = true;
|
|
103
89
|
constructor(deadlineMs) {
|
|
@@ -241,13 +227,6 @@ export class CooperativePassScheduler {
|
|
|
241
227
|
get hasActiveChore() {
|
|
242
228
|
return this.active?.workClass === "chore";
|
|
243
229
|
}
|
|
244
|
-
/**
|
|
245
|
-
* A chore owns the slot, or has lent it through a checkpoint or network
|
|
246
|
-
* hand-off and will take it back. Hand-offs only ever start from a chore.
|
|
247
|
-
*/
|
|
248
|
-
get choreHoldsSlot() {
|
|
249
|
-
return this.hasActiveChore || this._handoffActive || this.detachedChore !== null;
|
|
250
|
-
}
|
|
251
230
|
get hasActiveSlowRealtime() {
|
|
252
231
|
return this.active?.workClass === "realtime" && this.active.lane === "slow";
|
|
253
232
|
}
|
|
@@ -318,8 +297,12 @@ export class CooperativePassScheduler {
|
|
|
318
297
|
resolve,
|
|
319
298
|
reject,
|
|
320
299
|
};
|
|
321
|
-
if (workClass === "realtime" && this.
|
|
322
|
-
|
|
300
|
+
if (workClass === "realtime" && this.hasActiveChore) {
|
|
301
|
+
const deadlineMs = realtimeAdmissionDeadlineMs();
|
|
302
|
+
entry.admissionTimer = setTimeout(() => {
|
|
303
|
+
this.expireAdmission(entry, deadlineMs);
|
|
304
|
+
}, deadlineMs);
|
|
305
|
+
entry.admissionTimer.unref?.();
|
|
323
306
|
}
|
|
324
307
|
if (signal) {
|
|
325
308
|
const onAbort = () => {
|
|
@@ -368,44 +351,6 @@ export class CooperativePassScheduler {
|
|
|
368
351
|
}
|
|
369
352
|
this.pending.push(entry);
|
|
370
353
|
}
|
|
371
|
-
/**
|
|
372
|
-
* Bound how long a queued realtime entry sits behind a chore, counted from
|
|
373
|
-
* the first moment a chore holds the slot while it is queued. Time spent
|
|
374
|
-
* behind other realtime work does not count against it. Idempotent while
|
|
375
|
-
* the same chore holds the slot: an entry keeps its first deadline across
|
|
376
|
-
* that chore's hand-offs. Cleared when the chore finishes.
|
|
377
|
-
*/
|
|
378
|
-
armAdmission(entry) {
|
|
379
|
-
if (entry.workClass !== "realtime" || entry.admissionTimer !== undefined)
|
|
380
|
-
return;
|
|
381
|
-
const deadlineMs = realtimeAdmissionDeadlineMs();
|
|
382
|
-
entry.admissionTimer = setTimeout(() => {
|
|
383
|
-
this.expireAdmission(entry, deadlineMs);
|
|
384
|
-
}, deadlineMs);
|
|
385
|
-
entry.admissionTimer.unref?.();
|
|
386
|
-
}
|
|
387
|
-
/**
|
|
388
|
-
* A chore has taken (or taken back) the slot. Realtime queued while it
|
|
389
|
-
* was lent, or behind other realtime, would otherwise wait for the chore's
|
|
390
|
-
* next checkpoint with no bound.
|
|
391
|
-
*/
|
|
392
|
-
armQueuedRealtime() {
|
|
393
|
-
for (const entry of this.pending)
|
|
394
|
-
this.armAdmission(entry);
|
|
395
|
-
}
|
|
396
|
-
/**
|
|
397
|
-
* No chore holds the slot any more. Queued realtime now waits only behind
|
|
398
|
-
* other realtime, which does not count against the deadline; the next
|
|
399
|
-
* chore to take the slot arms a fresh one.
|
|
400
|
-
*/
|
|
401
|
-
disarmQueuedRealtime() {
|
|
402
|
-
for (const entry of this.pending) {
|
|
403
|
-
if (entry.admissionTimer === undefined)
|
|
404
|
-
continue;
|
|
405
|
-
clearTimeout(entry.admissionTimer);
|
|
406
|
-
entry.admissionTimer = undefined;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
354
|
clearAdmission(entry) {
|
|
410
355
|
if (entry.admissionTimer !== undefined) {
|
|
411
356
|
clearTimeout(entry.admissionTimer);
|
|
@@ -486,8 +431,6 @@ export class CooperativePassScheduler {
|
|
|
486
431
|
start(entry) {
|
|
487
432
|
this.clearAdmission(entry);
|
|
488
433
|
this.active = entry;
|
|
489
|
-
if (entry.workClass === "chore")
|
|
490
|
-
this.armQueuedRealtime();
|
|
491
434
|
let current;
|
|
492
435
|
try {
|
|
493
436
|
current = this.execute(entry);
|
|
@@ -513,8 +456,6 @@ export class CooperativePassScheduler {
|
|
|
513
456
|
complete(entry) {
|
|
514
457
|
if (this.active === entry)
|
|
515
458
|
this.active = null;
|
|
516
|
-
if (entry.workClass === "chore" && !this.choreHoldsSlot)
|
|
517
|
-
this.disarmQueuedRealtime();
|
|
518
459
|
this.drain();
|
|
519
460
|
}
|
|
520
461
|
startFastRealtime(entry) {
|
|
@@ -667,10 +608,8 @@ export class CooperativePassScheduler {
|
|
|
667
608
|
this.handoffDeferredAt = null;
|
|
668
609
|
this.handoffBacklog = null;
|
|
669
610
|
this.detachedChore = null;
|
|
670
|
-
if (!this.stopped)
|
|
611
|
+
if (!this.stopped)
|
|
671
612
|
this.active = entry;
|
|
672
|
-
this.armQueuedRealtime();
|
|
673
|
-
}
|
|
674
613
|
this.options.caps?.resumeAfterHandoff();
|
|
675
614
|
const resolveRelease = this.resolveNetworkTransferRelease;
|
|
676
615
|
const realtimeRan = this.handoffAdmitted;
|
|
@@ -893,10 +832,8 @@ export class CooperativePassScheduler {
|
|
|
893
832
|
this._handoffActive = false;
|
|
894
833
|
this.handoffDeferredAt = null;
|
|
895
834
|
this.handoffBacklog = null;
|
|
896
|
-
if (!this.stopped)
|
|
835
|
+
if (!this.stopped)
|
|
897
836
|
this.active = entry;
|
|
898
|
-
this.armQueuedRealtime();
|
|
899
|
-
}
|
|
900
837
|
this.options.caps?.resumeAfterHandoff();
|
|
901
838
|
}
|
|
902
839
|
return this.handoffAdmitted;
|
|
@@ -2157,16 +2094,7 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
2157
2094
|
const execution = {
|
|
2158
2095
|
run: async (slice) => {
|
|
2159
2096
|
telemetry?.mark("conflict");
|
|
2160
|
-
|
|
2161
|
-
try {
|
|
2162
|
-
result = await task(slice, telemetry, true);
|
|
2163
|
-
}
|
|
2164
|
-
catch (error) {
|
|
2165
|
-
if (error instanceof RealtimeAdmissionTimeoutError) {
|
|
2166
|
-
execution.admissionTimeout = error;
|
|
2167
|
-
}
|
|
2168
|
-
throw error;
|
|
2169
|
-
}
|
|
2097
|
+
const result = await task(slice, telemetry, true);
|
|
2170
2098
|
telemetry?.mark("commit");
|
|
2171
2099
|
return result;
|
|
2172
2100
|
},
|
|
@@ -2189,19 +2117,12 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
2189
2117
|
: "retryable";
|
|
2190
2118
|
telemetry.finish(outcomeLabel, realtimeTelemetryReason(outcome.paths));
|
|
2191
2119
|
}
|
|
2192
|
-
const admissionTimeout = execution.result === undefined &&
|
|
2193
|
-
execution.admissionTimeout !== undefined &&
|
|
2194
|
-
outcome.paths.length > 0 &&
|
|
2195
|
-
outcome.paths.every((path) => path.status === "retryable")
|
|
2196
|
-
? execution.admissionTimeout
|
|
2197
|
-
: undefined;
|
|
2198
2120
|
return {
|
|
2199
2121
|
result: execution.result ?? (allRefused ? 0 : 1),
|
|
2200
2122
|
accepted,
|
|
2201
2123
|
coordinatorRefusedPaths: normalizeCoordinatorPaths(outcome.paths
|
|
2202
2124
|
.filter((path) => path.status === "refused")
|
|
2203
2125
|
.map((path) => path.path)),
|
|
2204
|
-
...(admissionTimeout ? { admissionTimeout } : {}),
|
|
2205
2126
|
};
|
|
2206
2127
|
}
|
|
2207
2128
|
catch (error) {
|
|
@@ -3518,16 +3439,6 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
3518
3439
|
emitScopedPushFailureTelemetry?.(event);
|
|
3519
3440
|
}
|
|
3520
3441
|
};
|
|
3521
|
-
/**
|
|
3522
|
-
* The push never ran: a chore held the slot past the admission deadline.
|
|
3523
|
-
* Put the paths back and retry without counting a failure, so the route
|
|
3524
|
-
* backoff, the scoped-push-failure line and its telemetry stay for real
|
|
3525
|
-
* pass failures.
|
|
3526
|
-
*/
|
|
3527
|
-
const deferPushAfterAdmissionTimeout = (group, routeId) => {
|
|
3528
|
-
restorePendingWatcherPaths(group.paths, watcherBatchGeneration, group.changes);
|
|
3529
|
-
scheduleRoutePushRetry(routeId, REALTIME_ADMISSION_RETRY_MS);
|
|
3530
|
-
};
|
|
3531
3442
|
if (watcherDrainRunsPush && grouped) {
|
|
3532
3443
|
for (const group of grouped.values()) {
|
|
3533
3444
|
// Paused workspaces: drop the scoped push without uploading or
|
|
@@ -3625,9 +3536,6 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
3625
3536
|
}
|
|
3626
3537
|
}
|
|
3627
3538
|
}
|
|
3628
|
-
else if ("admissionTimeout" in execution && execution.admissionTimeout) {
|
|
3629
|
-
deferPushAfterAdmissionTimeout(group, routeId);
|
|
3630
|
-
}
|
|
3631
3539
|
else if (pushExit === UNRESOLVED_COMPANY_EXIT) {
|
|
3632
3540
|
routePushFailureBackoff.succeeded(routeId);
|
|
3633
3541
|
clearRoutePushRetry(routeId);
|
|
@@ -3646,10 +3554,6 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
3646
3554
|
}
|
|
3647
3555
|
}
|
|
3648
3556
|
catch (err) {
|
|
3649
|
-
if (err instanceof RealtimeAdmissionTimeoutError) {
|
|
3650
|
-
deferPushAfterAdmissionTimeout(group, routeId);
|
|
3651
|
-
continue;
|
|
3652
|
-
}
|
|
3653
3557
|
recordPushFailure(group.route, 1, pushFailureText(1, group.route, err));
|
|
3654
3558
|
restorePendingWatcherPaths(group.paths, watcherBatchGeneration, group.changes);
|
|
3655
3559
|
}
|
|
@@ -3664,7 +3568,6 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
3664
3568
|
// falls back to the unscoped drain shape.
|
|
3665
3569
|
if (grouped) {
|
|
3666
3570
|
let worstExit = 0;
|
|
3667
|
-
let deferred = false;
|
|
3668
3571
|
let ranPersonalDrain = false;
|
|
3669
3572
|
for (const group of grouped.values()) {
|
|
3670
3573
|
// Paused workspaces sync in NO direction while Off.
|
|
@@ -3695,25 +3598,12 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
3695
3598
|
const slicePaths = slice.paths.map((path) => path.canonicalPath);
|
|
3696
3599
|
return runGuarded(buildTargetedPullArgv(group.route, passArgv, slicePaths, exactFileUpserts.filter((relativePath) => slicePaths.includes(relativePath))), undefined, lane, "realtime", false, slice.signal, false, telemetry, coordinatorFenced);
|
|
3697
3600
|
})
|
|
3698
|
-
: await runGuarded(pullArgv, undefined, lane, "realtime")
|
|
3699
|
-
if (error instanceof RealtimeAdmissionTimeoutError) {
|
|
3700
|
-
return { accepted: false, admissionTimeout: error };
|
|
3701
|
-
}
|
|
3702
|
-
throw error;
|
|
3703
|
-
});
|
|
3704
|
-
if ("admissionTimeout" in execution && execution.admissionTimeout) {
|
|
3705
|
-
// The pull never ran. Keep its paths and retry, without the
|
|
3706
|
-
// pass-failure handling the shared exit code would get.
|
|
3707
|
-
restorePendingWatcherPaths(group.paths, watcherBatchGeneration, group.changes);
|
|
3708
|
-
scheduleRoutePushRetry(`pull:${routeKey(group.route)}`, REALTIME_ADMISSION_RETRY_MS);
|
|
3709
|
-
deferred = true;
|
|
3710
|
-
continue;
|
|
3711
|
-
}
|
|
3601
|
+
: { result: await runGuarded(pullArgv, undefined, lane, "realtime"), accepted: true };
|
|
3712
3602
|
const exit = scopedRouteDrainExit(execution);
|
|
3713
3603
|
if (exit !== 0 && worstExit === 0)
|
|
3714
3604
|
worstExit = exit;
|
|
3715
3605
|
}
|
|
3716
|
-
return worstExit
|
|
3606
|
+
return worstExit;
|
|
3717
3607
|
}
|
|
3718
3608
|
// An idle poll has no sound path scope. It also must not turn into an
|
|
3719
3609
|
// unlabelled all-vault pull: scheduled reconciles and the explicit safety
|
|
@@ -3944,8 +3834,7 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
3944
3834
|
continue;
|
|
3945
3835
|
const generation = ++nextWatcherBatchGeneration;
|
|
3946
3836
|
void runScopedDrain(lane, generation, true).then((exit) => {
|
|
3947
|
-
|
|
3948
|
-
if (exit === 0 || exit === SCOPED_DRAIN_DEFERRED)
|
|
3837
|
+
if (exit === 0)
|
|
3949
3838
|
return;
|
|
3950
3839
|
restorePendingWatcherPaths(lane.paths, generation);
|
|
3951
3840
|
interruptWait();
|
|
@@ -3966,7 +3855,7 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
3966
3855
|
// the same dirty signal as the compatibility drain.
|
|
3967
3856
|
realtimeState.scheduler?.signal("watcher");
|
|
3968
3857
|
void runScopedDrain(lanes.fast, generation, true, true).then((exit) => {
|
|
3969
|
-
if (exit === 0
|
|
3858
|
+
if (exit === 0)
|
|
3970
3859
|
return;
|
|
3971
3860
|
restorePendingWatcherPaths(lanes.fast.paths, generation);
|
|
3972
3861
|
interruptWait();
|
|
@@ -4126,10 +4015,6 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
4126
4015
|
return withScopeContentHashesFile(route, events, slicePaths, (contentHashesFile) => runGuarded(buildTargetedPullArgv(route, passArgv, slicePaths, exactFileUpserts, contentHashesFile), undefined, lane, "realtime", lane === "fast", slice.signal, false, telemetry, coordinatorFenced, receiverSignal));
|
|
4127
4016
|
});
|
|
4128
4017
|
const pathCount = events.length;
|
|
4129
|
-
// Rethrow the typed refusal so the receiver keeps the lease and
|
|
4130
|
-
// retries the whole batch, instead of bisecting a "failed" pull.
|
|
4131
|
-
if (execution.admissionTimeout)
|
|
4132
|
-
throw execution.admissionTimeout;
|
|
4133
4018
|
const exitCode = passExitCode(execution.result);
|
|
4134
4019
|
if (shouldAcknowledgeParallelUnresolvedCompany(execution.accepted, exitCode)) {
|
|
4135
4020
|
if (!unresolvedReceiverMessagesWereRedelivered(events, receiveCountsByPath)) {
|
|
@@ -4863,7 +4748,7 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
4863
4748
|
const catchupBatch = workingBatch;
|
|
4864
4749
|
const catchupGeneration = pending.generation;
|
|
4865
4750
|
void runScopedDrain(catchupBatch, catchupGeneration, true).then((exit) => {
|
|
4866
|
-
if (exit === 0
|
|
4751
|
+
if (exit === 0)
|
|
4867
4752
|
return;
|
|
4868
4753
|
restorePendingWatcherPaths(catchupBatch.paths, catchupGeneration);
|
|
4869
4754
|
interruptWait();
|
|
@@ -4956,11 +4841,6 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
4956
4841
|
// Keep the watcher alive while preserving the one-shot non-zero code.
|
|
4957
4842
|
process.stderr.write("hq-sync-runner: watch pass skipped — unresolved company target; retrying next poll\n");
|
|
4958
4843
|
}
|
|
4959
|
-
else if (exitCode === SCOPED_DRAIN_DEFERRED) {
|
|
4960
|
-
// Realtime admission deferred part of the scoped drain behind a
|
|
4961
|
-
// chore. The paths are restored and a retry is scheduled; nothing
|
|
4962
|
-
// failed, so nothing is reported.
|
|
4963
|
-
}
|
|
4964
4844
|
else if (exitCode !== 0) {
|
|
4965
4845
|
// A scoped company-resolution or per-pass failure is isolated to that
|
|
4966
4846
|
// pass. The error was emitted by the runner; terminating the daemon
|