@raybase/create 0.3.26 → 0.3.28
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/package.json
CHANGED
|
@@ -353,9 +353,10 @@ Repeatable handlers must be safe when they run late or more than once:
|
|
|
353
353
|
and schedule visibility before handing off.
|
|
354
354
|
- Each failed attempt, and each run that ends failed without one (its lease
|
|
355
355
|
expired, or it was denied), also logs `console.error("raybase.job.failed",
|
|
356
|
-
{ job, runId, organizationId, attempt, maxAttempts, retry,
|
|
357
|
-
for the Worker's logs and a host's tail events (`
|
|
358
|
-
|
|
356
|
+
{ job, runId, organizationId, reason, attempt, maxAttempts, retry,
|
|
357
|
+
partitionKey })` for the Worker's logs and a host's tail events (`reason`
|
|
358
|
+
is `threw`, `denied` or `lease_expired`; `organizationId` is the run's
|
|
359
|
+
scope, `"default"` in Core; `partitionKey` is the run's host
|
|
359
360
|
partition, null for app-level work). It never includes the input; set
|
|
360
361
|
`appConfig.jobs.logFailureMessages: true` only if the error messages hold
|
|
361
362
|
nothing private, since that adds them as `error`.
|
|
@@ -662,15 +663,18 @@ export const jobs = {
|
|
|
662
663
|
reaches the dead-letter queue.
|
|
663
664
|
- A run counts toward its limits while its lease is live. The lease is the
|
|
664
665
|
job's `leaseDuration`, else `appConfig.jobs.leaseDuration`, else `5 minutes`.
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
666
|
+
A running run renews its lease every third of it while its invocation
|
|
667
|
+
lives, so a handler may run longer than its lease. When a worker dies
|
|
668
|
+
mid-run, the renewals stop and the slot frees as soon as the lease expires:
|
|
669
|
+
the sweep fails the run (`raybase.job.failed` with `reason:
|
|
670
|
+
"lease_expired"`) and wakes the next waiter.
|
|
671
|
+
- So `leaseDuration` is how long a dead run's slot stays held, not how long a
|
|
672
|
+
run may take. A shorter lease frees a crashed run's slot sooner and renews
|
|
673
|
+
more often; the default suits most jobs. What bounds a run is its
|
|
674
|
+
invocation: Cloudflare ends a queue consumer invocation at its wall-time
|
|
675
|
+
limit (15 minutes at the time of writing), and then the run's lease lapses
|
|
676
|
+
and the sweep fails it. Split work longer than that into batches or
|
|
677
|
+
continuations (`ctx.jobs.enqueue` from the handler).
|
|
674
678
|
- Cancelling a run frees its slot at once, but its handler keeps running to
|
|
675
679
|
the end and its result is discarded. The next waiter can therefore start
|
|
676
680
|
while the cancelled handler is still finishing, and until it finishes the
|
|
@@ -184,7 +184,8 @@ ctx)` in the worker entry, ahead of the framework, as the templates have it;
|
|
|
184
184
|
`raybase doctor` warns (`host-routing`) when it is missing. Each failed job
|
|
185
185
|
attempt, and each run that ends failed without one (lease expired, denied),
|
|
186
186
|
logs `console.error("raybase.job.failed", { job, runId, organizationId,
|
|
187
|
-
attempt, maxAttempts, retry, partitionKey })` (`
|
|
187
|
+
reason, attempt, maxAttempts, retry, partitionKey })` (`reason` `threw`,
|
|
188
|
+
`denied` or `lease_expired`) (`organizationId` the run's
|
|
188
189
|
scope, `"default"` in Core; `partitionKey` null for app-level work), never with the input, and with the error's message only under
|
|
189
190
|
`appConfig.jobs.logFailureMessages: true`. See the
|
|
190
191
|
hosting guide (`docs/hosting.md` on the Raybase site) for the full contract.
|
|
@@ -120,7 +120,14 @@ private address: they are judged as every outbound fetch is
|
|
|
120
120
|
(`validateOutboundHttpsUrl`: localhost, metadata names, and every loopback,
|
|
121
121
|
private, link-local and special-purpose literal, IPv6 and mapped IPv4
|
|
122
122
|
included). Workers cannot see what a name resolves to, so the list is the
|
|
123
|
-
only guard against a public name that points somewhere private.
|
|
123
|
+
only guard against a public name that points somewhere private.
|
|
124
|
+
A client known only by its metadata document's address (a URL-form
|
|
125
|
+
`client_id`) is fetched once someone is signed in, never for a stranger: a
|
|
126
|
+
signed-out authorize request goes straight to sign-in, and comes back to be
|
|
127
|
+
validated in full. The fetched document's own `client_uri`, `logo_uri`,
|
|
128
|
+
`tos_uri` and `policy_uri` are judged as registration's are. The OAuth rate
|
|
129
|
+
limits key on the address Cloudflare connected (`cf-connecting-ip`), never on
|
|
130
|
+
a header a caller sets. For internal apps that should not accept new OAuth clients at
|
|
124
131
|
runtime, disable Dynamic Client Registration instead:
|
|
125
132
|
|
|
126
133
|
```ts
|