@sentry/cloudflare: Durable Object methods called from the constructor's blockConcurrencyWhile callback are captured as untraced RPC entries
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 58/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
Direzione di ricerca
Start in durableobject.ts at the RPC prototype wrapper and its startNewTrace branch, then run the provided Store reproduction with @cloudflare/vitest-pool-workers. Trace the constructor's blockConcurrencyWhile callback and verify that a caught init error no longer produces an error event or an untraced RPC entry.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Version
@sentry/cloudflare 10.75.1, with enableRpcTracePropagation: true
Summary
Since #24512, the RPC prototype wrapper instruments any prototype method called while the isolation scope is the default one, in a new trace. The wrapper is installed after construction, but a blockConcurrencyWhile callback started in the constructor runs after that, with no isolation scope. So a method the object calls on itself during initialisation is treated as an untraced RPC entry. If it throws, the error is captured as handled: false with mechanism auto.faas.cloudflare.durable_object, even when the object catches it.
Repro
class Store extends DurableObject {
failure?: Error;
constructor(ctx: DurableObjectState, env: Env) {
super(ctx, env);
void ctx.blockConcurrencyWhile(async () => {
try { this.init(); } catch (e) { this.failure = e as Error; }
});
}
init(): void { throw new Error('init failed'); }
ping(): string { return this.failure ? 'degraded' : 'ok'; }
}
export const Instrumented = Sentry.instrumentDurableObjectWithSentry(
(env) => ({ dsn: env.SENTRY_DSN, enableRpcTracePropagation: true }),
Store,
);
Call ping() on a stub.
Expected: no error event. The error is caught inside the object.
Actual: one error event for init failed, handled: false, in its own trace.
Observed in real workerd (@cloudflare/vitest-pool-workers). With a raised Error.stackTraceLimit, the capturing frame is the untraced startNewTrace branch in durableobject.ts, wrapping the method called from the constructor's blockConcurrencyWhile callback.
Notes
Declaring internal methods as #private avoids it, because they are no longer on the prototype, and that matches Cloudflare's RPC visibility guidance (https://developers.cloudflare.com/workers/runtime-apis/rpc/visibility/). It may be worth either documenting that, or running constructor-time blockConcurrencyWhile callbacks inside an isolation scope so they are not mistaken for RPC entries.
- Lingua principale
- TypeScript
- Stelle
- 8.7k
- Fork
- 1.9k
- Merge medio
- 1g 17h
- PR unite (30g)
- 543
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di getsentry/sentry-javascript
-
Browser Bug Next.js Traces
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
getsentry/sentry-javascript#24672 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
javascript
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
getsentry/sentry-javascript#24200 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
javascript Task
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
getsentry/sentry-javascript#24134 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Cloudflare Workers javascript Tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
getsentry/sentry-javascript#24051 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Bug Bun javascript
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
getsentry/sentry-javascript#24045 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di getsentry/sentry-javascript
Issue simili
-
module-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
ports get and web print 'Port N already in use, trying next...' for every busy port they skipAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
appandflow/stim#1604 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
lingdojo/kana-dojo#31060 · 1 commento · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
SSH workspace restore rewrites relative symlinks into the deleted sync-back staging directoryAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
paperclipai/paperclip#14173 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno