Accept hook_created in event batches so a run's boot hooks can go out in one write

Aperta
#5,449 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

The request sits between the client batch path (createWorkflowRunEventBatch, which only rejects hook_received) and the backend batch route, which currently refuses hook_created with "Unsupported eventType 'hook_created' in an event batch". Start by reading the batch response validator, since it expects each item's event type to match its request and would reject a hook_created answered with hook_conflict. Done means the backend accepts hook_created batches with per-item conflict reporting and the validator accepts that response. This touches the backend service, so it needs maintainer input on the protocol before a first-timer should attempt it.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

A run's first delivery writes its boot suspension's events one at a time through the in-band writer. On the Vercel World, each hook_created is its own fenced POST (~50–80ms), and inline step claims wait behind them. eve creates a Workflow AbortController for its first turn at boot (one hook as of vercel/eve#6446, previously two), so every new session pays for that write before its first step can start. A message resumed into the run while those writes are in flight also waits for them.

I tried writing a suspension's plain hook creations (distinct tokens, no metadata, abort, force or dispose) as one createBatch from startSuspensionHookWrites. The backend refuses it:

Unsupported eventType 'hook_created' in an event batch

The client side already allows it: createWorkflowRunEventBatch only rejects hook_received. One gap there: the batch response validator expects each item's event type to match its request, so a hook_created answered with hook_conflict would fail validation, where the single-event path accepts it.

Would it be possible for the batch route to accept hook_created (and answer a taken token with a per-item hook_conflict)? With that, a boot's hooks and its inline step claims could go out as one write. Rough estimate from eve's boot traces: 50–150ms off a new session's first output, depending on how many hooks it creates.

🤖

Lingua principale
TypeScript
Stelle
2.5k
Fork
401
Merge medio
2g 36m
PR unite (30g)
150

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di vercel/workflow

Tutte le issue di vercel/workflow

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.