Run the fqm-execution call in a worker thread — the nightly's 21-second stalls are inside a loop we do not own
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
- Área
- backend, performance
Línea de trabajo
Read ADR-085, wiring/executor-router.ts, wiring/official-executor-adapter.ts, and packages/official-executor/src/index.ts to trace the evaluateBatch path into fqm-execution. Run the existing nightly instrumentation and compare value-set cache transfer, warning and retrieve-signal behavior, and worker failure handling. Done means a documented decision supported by measurements and defined semantics for these open questions.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
#563 is diagnosed and half-answered. This is the other half, and it needs a decision rather than a
patch.
What #588 measured, and what #602-era work confirmed
evaluateBatch is 93.9% of a 90-minute nightly — ~21 s per 500-subject call, bundles 0.33%.
During that window GET /api/version, which opens no database connection and therefore cannot be
waiting for one, answered in 13.8–22.0 s against 0.2 s quiet.
The mechanism is now nailed down. Measured on the dev host, 60 iterations x 42 ms of CPU with a local
HTTP server probed concurrently:
| yield between iterations | requests served | worst latency |
|---|---|---|
| none | 1 | 2,534 ms |
queueMicrotask |
1 | 2,523 ms |
setImmediate |
31 | 43.5 ms |
setTimeout(0) |
105 | 85.6 ms |
A microtask yield changes nothing, because Node drains the whole microtask queue before reaching the
poll phase. Only a macrotask lets a pending request be served.
Why that does not finish the job
ADR-085 d1 applies the macrotask yield to the loops we own. The pilot's nightly is not one of them.
deps.engine.evaluateBatch resolves through wiring/executor-router.ts to runBatch
(wiring/official-executor-adapter.ts) to calculateOfficialWithSignal
(packages/official-executor/src/index.ts), which is:
const output = await calculate(input.bundle, input.patientBundles, options, input.valueSetCache);
One call into fqm-execution with every bundle in the chunk. We do not own that loop. All six of
the pilot's measures are official-routed (ADR-078), so this is ~the whole of its nightly.
WORKWELL_RUN_CHUNK_SIZE divides the stall — a chunk boundary is a real database write and therefore
a real yield point — but it cannot remove it, and it buys shorter stalls with more round trips.
The proposal
Run the fqm-execution call in a worker thread, so a CPU-bound third-party library stops
occupying the event loop that serves requests.
fqm-executionis Node-only already, so the@mieweb/cloudportability constraint that shaped
ADR-085 d1 does not bindpackages/official-executor.- The call's inputs (measure bundle, patient bundles, period, value-set cache) and its output are
plain JSON, so they are structured-cloneable — no shared handles to arrange. - The worker can be pooled or spawned per chunk; per chunk is simpler and the setup cost is amortised
over ~21 s of work.
Open questions for whoever picks this up:
- Does the value-set cache survive the boundary cheaply? It is the one input that could be large,
and copying it per chunk would show up inbatchMsimmediately (which is the nice part — the
instrumentation to check already exists). - What happens to
onWarningand the retrieve signal? Both cross back today as ordinary returns;
a warning currently emitted mid-call would need to be collected and returned instead. - Failure semantics. A worker crash must fail the chunk the way a thrown error does now, not
leave the run RUNNING — the same rule the chunked persist path already follows.
Not blocking anything today
The nightly runs 12:09–13:40 UTC, which is 02:09 Hawaii, and #590 removed the user-facing trap
(a MEASURE run that 504'd and invited a retry that also ran). This is about the sandbox being
usable while a run is in flight, and about the number not getting worse as the corpus grows.
Related: #563 (the measurement), #588 (the instrumentation), #590, ADR-085.
- Lenguaje dominante
- TypeScript
- Estrellas
- 0
- Forks
- 0
- Merge medio
- 4 h 5 min
- PR fusionados (30 d)
- 126
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Taleef7/workwell
-
documentation owner-ops waiting
Dificultad 1/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
owner-ops waiting
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
QRDA I import: an imported medication's stated end is invisible to CMS's medication-period logicAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 22/100
Los mantenedores suelen responder en 1 día
-
backend bug
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Taleef7/workwell#750 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
cql-engine pilot-trust
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
Todos los issues de Taleef7/workwell
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
auth: agent-bearer --manager-call is told to use the MCP instance argument on an ambiguous managerAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día
-
Lyric and ApostrophesAbiertobug module: playback
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
chthollyphile/folia-major#739 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
agilepathway/label-checker#773 · 2 comentarios ·
Los mantenedores suelen responder en 1 día