@substrat-run/adapter-cloudflare 0.213.0 → 0.215.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/control-plane-do.d.ts +89 -6
- package/dist/control-plane-do.d.ts.map +1 -1
- package/dist/control-plane-do.js +310 -12
- package/dist/control-plane-do.js.map +1 -1
- package/dist/directory-split-inventory.d.ts +2 -2
- package/dist/directory-split-inventory.d.ts.map +1 -1
- package/dist/directory-split-inventory.js +8 -2
- package/dist/directory-split-inventory.js.map +1 -1
- package/dist/host.d.ts +5 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +46 -2
- package/dist/host.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/kick-coalescer-do.d.ts +13 -3
- package/dist/kick-coalescer-do.d.ts.map +1 -1
- package/dist/kick-coalescer-do.js +20 -6
- package/dist/kick-coalescer-do.js.map +1 -1
- package/dist/reconcile-on-wake.d.ts +35 -0
- package/dist/reconcile-on-wake.d.ts.map +1 -0
- package/dist/reconcile-on-wake.js +75 -0
- package/dist/reconcile-on-wake.js.map +1 -0
- package/dist/route-read-model-publisher.d.ts +171 -0
- package/dist/route-read-model-publisher.d.ts.map +1 -0
- package/dist/route-read-model-publisher.js +524 -0
- package/dist/route-read-model-publisher.js.map +1 -0
- package/dist/route-read-model.d.ts +166 -0
- package/dist/route-read-model.d.ts.map +1 -0
- package/dist/route-read-model.js +195 -0
- package/dist/route-read-model.js.map +1 -0
- package/dist/route-resolver.d.ts +41 -3
- package/dist/route-resolver.d.ts.map +1 -1
- package/dist/route-resolver.js +58 -3
- package/dist/route-resolver.js.map +1 -1
- package/dist/scope-do.d.ts +8 -0
- package/dist/scope-do.d.ts.map +1 -1
- package/dist/scope-do.js +133 -6
- package/dist/scope-do.js.map +1 -1
- package/dist/scope-wake.d.ts +127 -0
- package/dist/scope-wake.d.ts.map +1 -0
- package/dist/scope-wake.js +204 -0
- package/dist/scope-wake.js.map +1 -0
- package/package.json +9 -9
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { ScopeId, TenantId } from '@substrat-run/contracts';
|
|
2
|
+
/**
|
|
3
|
+
* A scope that has work for the platform wakes itself (K-69, no scheduled walk over tenants;
|
|
4
|
+
* rfc/tenant-scale.md §7.4, step 4).
|
|
5
|
+
*
|
|
6
|
+
* Two kinds of work leave a scope only when the platform comes for them: its pending platform
|
|
7
|
+
* intents (`_substrat_platform_requests`) and its outbox rows not yet shipped to the lake
|
|
8
|
+
* (`_substrat_outbox.drained_at IS NULL`). Until now the control plane's `*\/15` pass walked every
|
|
9
|
+
* active scope to look, 96 times a day, whether the scope had any. Here the scope asks instead: after
|
|
10
|
+
* a commit leaves work of either kind, it arms its alarm, and the alarm asks the control plane to
|
|
11
|
+
* drain it (`/internal/drain-scope`, the router's kick, #3388's per-scope drain object). While the
|
|
12
|
+
* work stays, the alarm stays armed, backing off to the pass's own cadence. A scope with nothing
|
|
13
|
+
* pending arms nothing, so an idle scope costs no request at all (D-79, idle tenant costs storage only).
|
|
14
|
+
*
|
|
15
|
+
* The control plane's answer says, per phase, who owns the work right now: `scope` (its switch,
|
|
16
|
+
* `SCOPE_WAKE_PHASES`, hands the phase to the scopes and its pass only checks) or `pass` (the pass
|
|
17
|
+
* still drains it, as it always has). A phase the pass owns gets the commit's kick and no retries:
|
|
18
|
+
* an intent's attempt ceiling is counted in drains and calibrated to the pass's cadence, and two
|
|
19
|
+
* drivers would spend it twice as fast. A control plane that predates the answer is read as `pass`.
|
|
20
|
+
*
|
|
21
|
+
* This module is the decision, with no I/O of its own: the scope object hands it what it found
|
|
22
|
+
* (`WakeWork`) and how to reach the control plane (`kick`), and stores what it returns.
|
|
23
|
+
*/
|
|
24
|
+
/** How long after a commit that enqueued an intent the scope asks for a drain. */
|
|
25
|
+
export declare const SCOPE_WAKE_INTENTS_DELAY_MS = 2000;
|
|
26
|
+
/**
|
|
27
|
+
* How long after a commit that left undrained events the scope asks for the lake drain. Shipping
|
|
28
|
+
* coalesces within it: a busy scope ships at most once per window, and an event reaches the lake
|
|
29
|
+
* within it, where the pass took up to 15 minutes. Proposed default; the owner's choice.
|
|
30
|
+
*/
|
|
31
|
+
export declare const SCOPE_WAKE_EVENTS_DELAY_MS: number;
|
|
32
|
+
/**
|
|
33
|
+
* The gaps between a scope's looks while its work stays, once the control plane owns nothing for it
|
|
34
|
+
* or a kick was lost: one, two, four and eight minutes, then the pass's 15 for as long as it lasts.
|
|
35
|
+
* Each look checks first and asks only if the work is still there.
|
|
36
|
+
*/
|
|
37
|
+
export declare const SCOPE_WAKE_BACKOFF_MS: readonly number[];
|
|
38
|
+
/** How long a scope leaves its lake shipping to the pass once the control plane says the pass owns it. */
|
|
39
|
+
export declare const SCOPE_WAKE_PASS_HOLD_MS: number;
|
|
40
|
+
export type WakePhase = 'intents' | 'events';
|
|
41
|
+
/**
|
|
42
|
+
* What the scope found after a commit: two reads by index, a row or two each. Every commit pays
|
|
43
|
+
* them, so neither scans: the intent table has no index on its status, and the newest id by primary
|
|
44
|
+
* key says whether anything was enqueued since the scope last asked.
|
|
45
|
+
*/
|
|
46
|
+
export interface CommitWork {
|
|
47
|
+
/** The newest intent's id, whatever its status, or null when the scope has none. */
|
|
48
|
+
newestIntent: string | null;
|
|
49
|
+
/** Any outbox row this scope emitted that has not been shipped. */
|
|
50
|
+
undrainedEvents: boolean;
|
|
51
|
+
}
|
|
52
|
+
/** What the scope found at its alarm, which also asks whether any intent is still pending. */
|
|
53
|
+
export interface WakeWork extends CommitWork {
|
|
54
|
+
pendingIntents: boolean;
|
|
55
|
+
}
|
|
56
|
+
/** Who owns a phase's work, as the control plane answered (`scope`), or the pass still does. */
|
|
57
|
+
export type WakeOwner = 'scope' | 'pass';
|
|
58
|
+
/** The control plane's answer to a scope's kick. Null: the kick did not land. */
|
|
59
|
+
export interface WakeAnswer {
|
|
60
|
+
platformRequests?: WakeOwner;
|
|
61
|
+
events?: WakeOwner;
|
|
62
|
+
}
|
|
63
|
+
/** The body a scope's kick carries — the router kick's, with `events` and its source. */
|
|
64
|
+
export interface WakeKick {
|
|
65
|
+
tenantId: TenantId;
|
|
66
|
+
scopeId: ScopeId;
|
|
67
|
+
platformRequests: boolean;
|
|
68
|
+
events: boolean;
|
|
69
|
+
source: 'scope';
|
|
70
|
+
}
|
|
71
|
+
/** What a scope keeps between its wakes, in its own storage (`SCOPE_WAKE_KEY`). */
|
|
72
|
+
export interface ScopeWakeState {
|
|
73
|
+
tenantId: TenantId;
|
|
74
|
+
scopeId: ScopeId;
|
|
75
|
+
/** Epoch ms each phase is next looked at. Absent: nothing due. */
|
|
76
|
+
due: Partial<Record<WakePhase, number>>;
|
|
77
|
+
/** Looks that found the phase's work still there, for the back-off. */
|
|
78
|
+
retries: Partial<Record<WakePhase, number>>;
|
|
79
|
+
/** The newest intent the scope's alarm has already looked at: a commit adding none newer asks nothing. */
|
|
80
|
+
intentsMark?: string;
|
|
81
|
+
/** Epoch ms until which lake shipping is left to the pass (`SCOPE_WAKE_PASS_HOLD_MS`). */
|
|
82
|
+
eventsHeldUntil?: number;
|
|
83
|
+
}
|
|
84
|
+
/** The storage key a scope keeps its wake under. Storage KV, never SQL: dumps and module SQL cannot see it. */
|
|
85
|
+
export declare const SCOPE_WAKE_KEY = "scope-wake";
|
|
86
|
+
/**
|
|
87
|
+
* After a commit: what to arm. Returns the new state, or `null` when nothing changes (the common
|
|
88
|
+
* case on a busy scope: its wake is already armed, or it has nothing pending).
|
|
89
|
+
*
|
|
90
|
+
* An intent wakes the scope only when it is NEWER than what a kick already asked for. A pending
|
|
91
|
+
* intent that keeps failing is the back-off's to retry, never every commit's: the drain spends one
|
|
92
|
+
* of its attempts each time it runs it.
|
|
93
|
+
*/
|
|
94
|
+
export declare function wakeAfterCommit(prior: ScopeWakeState | null, ids: {
|
|
95
|
+
tenantId: TenantId;
|
|
96
|
+
scopeId: ScopeId;
|
|
97
|
+
}, work: CommitWork, now: number): ScopeWakeState | null;
|
|
98
|
+
/** The instant the scope's alarm should fire for its wake, or null when nothing is due. */
|
|
99
|
+
export declare function wakeDueAt(state: ScopeWakeState | null): number | null;
|
|
100
|
+
/**
|
|
101
|
+
* The alarm: look at each due phase, ask for what is still there, and say when to look again.
|
|
102
|
+
* Returns the state to keep, or `null` when nothing is left to keep (delete it).
|
|
103
|
+
*
|
|
104
|
+
* `probe` runs only when a phase is due, and `kick` only when a due phase still has work.
|
|
105
|
+
*/
|
|
106
|
+
export declare function runWake(state: ScopeWakeState, now: number, probe: () => WakeWork, kick: (body: WakeKick) => Promise<WakeAnswer | null>): Promise<ScopeWakeState | null>;
|
|
107
|
+
/**
|
|
108
|
+
* What the alarm stores after its kick, keeping what a commit registered while the kick was out.
|
|
109
|
+
*
|
|
110
|
+
* The alarm reads the state (`read`), awaits the control plane, and builds `next` from that read.
|
|
111
|
+
* The object takes other calls during the await, so a commit may have stored a phase in the
|
|
112
|
+
* meantime (`fresh`). Writing `next` as it stands would drop it, and the wake it asked for with it.
|
|
113
|
+
* So a phase whose due time in `fresh` differs from the one the alarm read was set meanwhile, and is
|
|
114
|
+
* kept: the earlier of it and `next`'s. A newer intent mark is kept too.
|
|
115
|
+
*/
|
|
116
|
+
export declare function keepRegisteredMeanwhile(read: ScopeWakeState, next: ScopeWakeState | null, fresh: ScopeWakeState | null): ScopeWakeState | null;
|
|
117
|
+
/**
|
|
118
|
+
* The kick, over the control plane's origin and the platform secret the upload injects into every
|
|
119
|
+
* pushed vertical (`CONTROL_PLANE_URL`, `PLATFORM_SECRET`), as the scope sweeper's kick goes. Null
|
|
120
|
+
* when the call did not land or the answer was not a 2xx; an answer without `wake` (a control plane
|
|
121
|
+
* that predates it) reads as `{}`, which `runWake` takes as the pass owning both phases.
|
|
122
|
+
*/
|
|
123
|
+
export declare function kickControlPlane(platform: {
|
|
124
|
+
controlPlaneUrl: string;
|
|
125
|
+
secret: string;
|
|
126
|
+
}, body: WakeKick): Promise<WakeAnswer | null>;
|
|
127
|
+
//# sourceMappingURL=scope-wake.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-wake.d.ts","sourceRoot":"","sources":["../src/scope-wake.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGjE;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,kFAAkF;AAClF,eAAO,MAAM,2BAA2B,OAAQ,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,QAAa,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAA8D,CAAC;AAElH,0GAA0G;AAC1G,eAAO,MAAM,uBAAuB,QAAc,CAAC;AAEnD,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE7C;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,oFAAoF;IACpF,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,mEAAmE;IACnE,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,8FAA8F;AAC9F,MAAM,WAAW,QAAS,SAAQ,UAAU;IAC1C,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,gGAAgG;AAChG,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzC,iFAAiF;AACjF,MAAM,WAAW,UAAU;IACzB,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,yFAAyF;AACzF,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,mFAAmF;AACnF,MAAM,WAAW,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AAQ,EAAE;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EACrD,IAAI,EAAE,QAAQ,GACb,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAgB5B"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { PLATFORM_SECRET_HEADER } from '@substrat-run/contracts/wire-headers';
|
|
2
|
+
/**
|
|
3
|
+
* A scope that has work for the platform wakes itself (K-69, no scheduled walk over tenants;
|
|
4
|
+
* rfc/tenant-scale.md §7.4, step 4).
|
|
5
|
+
*
|
|
6
|
+
* Two kinds of work leave a scope only when the platform comes for them: its pending platform
|
|
7
|
+
* intents (`_substrat_platform_requests`) and its outbox rows not yet shipped to the lake
|
|
8
|
+
* (`_substrat_outbox.drained_at IS NULL`). Until now the control plane's `*\/15` pass walked every
|
|
9
|
+
* active scope to look, 96 times a day, whether the scope had any. Here the scope asks instead: after
|
|
10
|
+
* a commit leaves work of either kind, it arms its alarm, and the alarm asks the control plane to
|
|
11
|
+
* drain it (`/internal/drain-scope`, the router's kick, #3388's per-scope drain object). While the
|
|
12
|
+
* work stays, the alarm stays armed, backing off to the pass's own cadence. A scope with nothing
|
|
13
|
+
* pending arms nothing, so an idle scope costs no request at all (D-79, idle tenant costs storage only).
|
|
14
|
+
*
|
|
15
|
+
* The control plane's answer says, per phase, who owns the work right now: `scope` (its switch,
|
|
16
|
+
* `SCOPE_WAKE_PHASES`, hands the phase to the scopes and its pass only checks) or `pass` (the pass
|
|
17
|
+
* still drains it, as it always has). A phase the pass owns gets the commit's kick and no retries:
|
|
18
|
+
* an intent's attempt ceiling is counted in drains and calibrated to the pass's cadence, and two
|
|
19
|
+
* drivers would spend it twice as fast. A control plane that predates the answer is read as `pass`.
|
|
20
|
+
*
|
|
21
|
+
* This module is the decision, with no I/O of its own: the scope object hands it what it found
|
|
22
|
+
* (`WakeWork`) and how to reach the control plane (`kick`), and stores what it returns.
|
|
23
|
+
*/
|
|
24
|
+
/** How long after a commit that enqueued an intent the scope asks for a drain. */
|
|
25
|
+
export const SCOPE_WAKE_INTENTS_DELAY_MS = 2_000;
|
|
26
|
+
/**
|
|
27
|
+
* How long after a commit that left undrained events the scope asks for the lake drain. Shipping
|
|
28
|
+
* coalesces within it: a busy scope ships at most once per window, and an event reaches the lake
|
|
29
|
+
* within it, where the pass took up to 15 minutes. Proposed default; the owner's choice.
|
|
30
|
+
*/
|
|
31
|
+
export const SCOPE_WAKE_EVENTS_DELAY_MS = 5 * 60_000;
|
|
32
|
+
/**
|
|
33
|
+
* The gaps between a scope's looks while its work stays, once the control plane owns nothing for it
|
|
34
|
+
* or a kick was lost: one, two, four and eight minutes, then the pass's 15 for as long as it lasts.
|
|
35
|
+
* Each look checks first and asks only if the work is still there.
|
|
36
|
+
*/
|
|
37
|
+
export const SCOPE_WAKE_BACKOFF_MS = [60_000, 2 * 60_000, 4 * 60_000, 8 * 60_000, 15 * 60_000];
|
|
38
|
+
/** How long a scope leaves its lake shipping to the pass once the control plane says the pass owns it. */
|
|
39
|
+
export const SCOPE_WAKE_PASS_HOLD_MS = 60 * 60_000;
|
|
40
|
+
/** The storage key a scope keeps its wake under. Storage KV, never SQL: dumps and module SQL cannot see it. */
|
|
41
|
+
export const SCOPE_WAKE_KEY = 'scope-wake';
|
|
42
|
+
const backoff = (retries) => SCOPE_WAKE_BACKOFF_MS[Math.min(Math.max(retries, 1), SCOPE_WAKE_BACKOFF_MS.length) - 1];
|
|
43
|
+
const blank = (ids) => ({
|
|
44
|
+
tenantId: ids.tenantId,
|
|
45
|
+
scopeId: ids.scopeId,
|
|
46
|
+
due: {},
|
|
47
|
+
retries: {},
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* After a commit: what to arm. Returns the new state, or `null` when nothing changes (the common
|
|
51
|
+
* case on a busy scope: its wake is already armed, or it has nothing pending).
|
|
52
|
+
*
|
|
53
|
+
* An intent wakes the scope only when it is NEWER than what a kick already asked for. A pending
|
|
54
|
+
* intent that keeps failing is the back-off's to retry, never every commit's: the drain spends one
|
|
55
|
+
* of its attempts each time it runs it.
|
|
56
|
+
*/
|
|
57
|
+
export function wakeAfterCommit(prior, ids, work, now) {
|
|
58
|
+
const freshIntent = work.newestIntent !== null && (prior?.intentsMark === undefined || work.newestIntent > prior.intentsMark);
|
|
59
|
+
const intentsAt = now + SCOPE_WAKE_INTENTS_DELAY_MS;
|
|
60
|
+
const wantsIntents = freshIntent && !(prior?.due.intents !== undefined && prior.due.intents <= intentsAt);
|
|
61
|
+
const held = prior?.eventsHeldUntil !== undefined && prior.eventsHeldUntil > now;
|
|
62
|
+
const wantsEvents = work.undrainedEvents && prior?.due.events === undefined && !held;
|
|
63
|
+
if (!wantsIntents && !wantsEvents)
|
|
64
|
+
return null;
|
|
65
|
+
const next = prior
|
|
66
|
+
? { ...prior, due: { ...prior.due }, retries: { ...prior.retries } }
|
|
67
|
+
: blank(ids);
|
|
68
|
+
if (wantsIntents) {
|
|
69
|
+
next.due.intents = intentsAt;
|
|
70
|
+
delete next.retries.intents;
|
|
71
|
+
}
|
|
72
|
+
if (wantsEvents)
|
|
73
|
+
next.due.events = now + SCOPE_WAKE_EVENTS_DELAY_MS;
|
|
74
|
+
return next;
|
|
75
|
+
}
|
|
76
|
+
/** The instant the scope's alarm should fire for its wake, or null when nothing is due. */
|
|
77
|
+
export function wakeDueAt(state) {
|
|
78
|
+
if (!state)
|
|
79
|
+
return null;
|
|
80
|
+
const times = Object.values(state.due).filter((t) => typeof t === 'number');
|
|
81
|
+
return times.length ? Math.min(...times) : null;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The alarm: look at each due phase, ask for what is still there, and say when to look again.
|
|
85
|
+
* Returns the state to keep, or `null` when nothing is left to keep (delete it).
|
|
86
|
+
*
|
|
87
|
+
* `probe` runs only when a phase is due, and `kick` only when a due phase still has work.
|
|
88
|
+
*/
|
|
89
|
+
export async function runWake(state, now, probe, kick) {
|
|
90
|
+
const next = { ...state, due: { ...state.due }, retries: { ...state.retries } };
|
|
91
|
+
const due = (p) => next.due[p] !== undefined && next.due[p] <= now;
|
|
92
|
+
if (!due('intents') && !due('events'))
|
|
93
|
+
return settled(next, now);
|
|
94
|
+
const work = probe();
|
|
95
|
+
const asks = {
|
|
96
|
+
intents: due('intents') && work.pendingIntents,
|
|
97
|
+
events: due('events') && work.undrainedEvents,
|
|
98
|
+
};
|
|
99
|
+
// Looked at: a later commit wakes the scope only for an intent newer than this, settled or not.
|
|
100
|
+
// Advanced whatever the kick's fate, since a pending intent's retries are the back-off's, not a commit's.
|
|
101
|
+
if (due('intents') && work.newestIntent !== null)
|
|
102
|
+
next.intentsMark = work.newestIntent;
|
|
103
|
+
// A due phase whose work is gone is done: a drain from elsewhere (the router's kick, the pass) took it.
|
|
104
|
+
for (const p of ['intents', 'events']) {
|
|
105
|
+
if (due(p) && !asks[p]) {
|
|
106
|
+
delete next.due[p];
|
|
107
|
+
delete next.retries[p];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (!asks.intents && !asks.events)
|
|
111
|
+
return settled(next, now);
|
|
112
|
+
const answer = await kick({
|
|
113
|
+
tenantId: state.tenantId,
|
|
114
|
+
scopeId: state.scopeId,
|
|
115
|
+
platformRequests: asks.intents,
|
|
116
|
+
events: asks.events,
|
|
117
|
+
source: 'scope',
|
|
118
|
+
}).catch(() => null);
|
|
119
|
+
const owner = (p) => answer === null ? 'lost' : ((p === 'intents' ? answer.platformRequests : answer.events) ?? 'pass');
|
|
120
|
+
for (const p of ['intents', 'events']) {
|
|
121
|
+
if (!asks[p])
|
|
122
|
+
continue;
|
|
123
|
+
const o = owner(p);
|
|
124
|
+
if (o === 'pass') {
|
|
125
|
+
// The pass drains it, as it always has. No retries from here, which would spend an intent's
|
|
126
|
+
// attempts twice as fast or ship an event the pass is shipping too.
|
|
127
|
+
delete next.due[p];
|
|
128
|
+
delete next.retries[p];
|
|
129
|
+
if (p === 'events')
|
|
130
|
+
next.eventsHeldUntil = now + SCOPE_WAKE_PASS_HOLD_MS;
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
// `scope`: the drain is on its way; look again later and ask once more if the work is still
|
|
134
|
+
// there. `lost`: the kick never landed, so nothing was spent; ask again on the same back-off.
|
|
135
|
+
const retries = (next.retries[p] ?? 0) + 1;
|
|
136
|
+
next.retries[p] = retries;
|
|
137
|
+
next.due[p] = now + backoff(retries);
|
|
138
|
+
if (p === 'events' && o === 'scope')
|
|
139
|
+
delete next.eventsHeldUntil;
|
|
140
|
+
}
|
|
141
|
+
return settled(next, now);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* What the alarm stores after its kick, keeping what a commit registered while the kick was out.
|
|
145
|
+
*
|
|
146
|
+
* The alarm reads the state (`read`), awaits the control plane, and builds `next` from that read.
|
|
147
|
+
* The object takes other calls during the await, so a commit may have stored a phase in the
|
|
148
|
+
* meantime (`fresh`). Writing `next` as it stands would drop it, and the wake it asked for with it.
|
|
149
|
+
* So a phase whose due time in `fresh` differs from the one the alarm read was set meanwhile, and is
|
|
150
|
+
* kept: the earlier of it and `next`'s. A newer intent mark is kept too.
|
|
151
|
+
*/
|
|
152
|
+
export function keepRegisteredMeanwhile(read, next, fresh) {
|
|
153
|
+
if (!fresh)
|
|
154
|
+
return next;
|
|
155
|
+
const meanwhile = ['intents', 'events'].filter((p) => fresh.due[p] !== undefined && fresh.due[p] !== read.due[p]);
|
|
156
|
+
const newerMark = fresh.intentsMark !== undefined && (next?.intentsMark === undefined || fresh.intentsMark > next.intentsMark);
|
|
157
|
+
if (meanwhile.length === 0 && !newerMark)
|
|
158
|
+
return next;
|
|
159
|
+
const merged = next
|
|
160
|
+
? { ...next, due: { ...next.due }, retries: { ...next.retries } }
|
|
161
|
+
: { tenantId: fresh.tenantId, scopeId: fresh.scopeId, due: {}, retries: {} };
|
|
162
|
+
for (const p of meanwhile) {
|
|
163
|
+
const theirs = fresh.due[p];
|
|
164
|
+
merged.due[p] = merged.due[p] === undefined ? theirs : Math.min(merged.due[p], theirs);
|
|
165
|
+
}
|
|
166
|
+
if (newerMark)
|
|
167
|
+
merged.intentsMark = fresh.intentsMark;
|
|
168
|
+
return merged;
|
|
169
|
+
}
|
|
170
|
+
/** Drop what no longer says anything; null when the whole state says nothing. */
|
|
171
|
+
function settled(state, now) {
|
|
172
|
+
if (state.eventsHeldUntil !== undefined && state.eventsHeldUntil <= now)
|
|
173
|
+
delete state.eventsHeldUntil;
|
|
174
|
+
const keeps = wakeDueAt(state) !== null || state.eventsHeldUntil !== undefined || state.intentsMark !== undefined;
|
|
175
|
+
if (!keeps)
|
|
176
|
+
return null;
|
|
177
|
+
// A mark with nothing armed is still worth keeping: without it the next commit would ask again for
|
|
178
|
+
// an intent a kick already covered. It is one short string.
|
|
179
|
+
return state;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* The kick, over the control plane's origin and the platform secret the upload injects into every
|
|
183
|
+
* pushed vertical (`CONTROL_PLANE_URL`, `PLATFORM_SECRET`), as the scope sweeper's kick goes. Null
|
|
184
|
+
* when the call did not land or the answer was not a 2xx; an answer without `wake` (a control plane
|
|
185
|
+
* that predates it) reads as `{}`, which `runWake` takes as the pass owning both phases.
|
|
186
|
+
*/
|
|
187
|
+
export async function kickControlPlane(platform, body) {
|
|
188
|
+
const res = await fetch(new URL('/internal/drain-scope', platform.controlPlaneUrl), {
|
|
189
|
+
method: 'POST',
|
|
190
|
+
headers: { 'content-type': 'application/json', [PLATFORM_SECRET_HEADER]: platform.secret },
|
|
191
|
+
body: JSON.stringify(body),
|
|
192
|
+
});
|
|
193
|
+
if (!res.ok) {
|
|
194
|
+
await res.body?.cancel();
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
const answer = (await res.json().catch(() => ({})));
|
|
198
|
+
const ownerOf = (v) => (v === 'scope' || v === 'pass' ? v : undefined);
|
|
199
|
+
const wake = answer.wake ?? {};
|
|
200
|
+
const platformRequests = ownerOf(wake.platformRequests);
|
|
201
|
+
const events = ownerOf(wake.events);
|
|
202
|
+
return { ...(platformRequests ? { platformRequests } : {}), ...(events ? { events } : {}) };
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=scope-wake.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-wake.js","sourceRoot":"","sources":["../src/scope-wake.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,kFAAkF;AAClF,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,CAAC;AAEjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,GAAG,MAAM,CAAC;AAErD;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAsB,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,EAAE,GAAG,MAAM,CAAC,CAAC;AAElH,0GAA0G;AAC1G,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,GAAG,MAAM,CAAC;AAqDnD,+GAA+G;AAC/G,MAAM,CAAC,MAAM,cAAc,GAAG,YAAY,CAAC;AAE3C,MAAM,OAAO,GAAG,CAAC,OAAe,EAAU,EAAE,CAC1C,qBAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,qBAAqB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAE,CAAC;AAE3F,MAAM,KAAK,GAAG,CAAC,GAA6C,EAAkB,EAAE,CAAC,CAAC;IAChF,QAAQ,EAAE,GAAG,CAAC,QAAQ;IACtB,OAAO,EAAE,GAAG,CAAC,OAAO;IACpB,GAAG,EAAE,EAAE;IACP,OAAO,EAAE,EAAE;CACZ,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe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,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AAC9F,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@substrat-run/adapter-cloudflare",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.215.0",
|
|
4
4
|
"description": "Cloudflare Durable-Object scope host (D-14): DO-per-scope, real kernel semantics on Workers",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"dist"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@substrat-run/kernel": "^0.
|
|
30
|
-
"@substrat-run/contracts": "^0.
|
|
29
|
+
"@substrat-run/kernel": "^0.215.0",
|
|
30
|
+
"@substrat-run/contracts": "^0.214.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@cloudflare/vitest-plugin": "^1.4.12",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"typescript": "^7.0.0",
|
|
37
37
|
"vitest": "^5.0.5",
|
|
38
38
|
"wrangler": "^4.156.1",
|
|
39
|
-
"@substrat-run/
|
|
40
|
-
"@substrat-run/
|
|
41
|
-
"@substrat-run/
|
|
42
|
-
"@substrat-run/
|
|
43
|
-
"@substrat-run/vertical-auth": "^0.38.
|
|
44
|
-
"@substrat-run/vertical-host": "^0.
|
|
39
|
+
"@substrat-run/attachment-extractors": "^0.2.76",
|
|
40
|
+
"@substrat-run/contract-tests": "^0.215.0",
|
|
41
|
+
"@substrat-run/control-plane-api": "^0.215.0",
|
|
42
|
+
"@substrat-run/cli": "^0.62.7",
|
|
43
|
+
"@substrat-run/vertical-auth": "^0.38.6",
|
|
44
|
+
"@substrat-run/vertical-host": "^0.215.0"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|