Engine: asynchronous code in the worker's publish causes events to be lost
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
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- node.js, typescript
- Ambito
- backend, distributed-systems
Direzione di ricerca
Inizia dal ciclo asincrono delle dimensioni del payload introdotto in #1366 e traccia parentPort.postMessage fino all'arresto del worker. Riproduci i casi di ordinamento e di messaggi persi descritti qui, quindi verifica che gli eventi emessi escano dal worker nell'ordine e non vengano persi quando l'attività termina.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Inside the engine, we run job code in a worker thread. The worker thread sends events out to the main engine process through parentPort.postMessage
In production right now this is synchronous. When the message is posted the payload is processed and sent out of the child worker. This ensures that messages leave the worker_thread in the same order that they were emitted from the runtime.
In #1366 we use an async loop to read the size of a payload before sending it. This async loop is causing two problems:
- It no longer guarantees that events will leave the worker thread in the same order as they're emitted, because of the async yield. If message a takes longer to process than message b, than message b might be piped through the port first.
- Some messages don't get emitted at all because the worker thread is shut down while the events are being processed. When we complete the task and exit the run, I don't think there's anyway to know that messages are still processing and waiting to be emitted.
I don't think this is affecting production, but it's a possible cause of #1072. What I'm worried about is that a message emitted with a large-ish payload, but the worker thread gets killed before that message is completed.
I'd sort of expect node.js to handle that for me and not exit the worker until the message has finished posting, but it's possible that we're exiting too soon (because of code or config in the engine).
- Lingua principale
- TypeScript
- Stelle
- 22
- Fork
- 22
- Merge medio
- 1g 7h
- PR unite (30g)
- 24
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
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 OpenFn/kit
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
OpenFn/kit#1574 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
OpenFn/kit#1551 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Worker: ignore sentry errors `Credential environment mismatch`Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
OpenFn/kit#1460 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
CLI
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Endpoint links in the tag operations list are below the 24px target sizeForse già presa @AdzerKI l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
ai-driven-qa bug Minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
linagora/twake-tasks#435 ·
I maintainer di solito rispondono entro 1 giorno
-
bug domain: database priority: p1 Stellar Wave
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
StellarState/SS-backend#632 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
A2A audit timestamps end in +00:00Z (invalid ISO 8601)Forse già presa @O1sumitkumar l’ha presa oggi. Apertabug good first issue help wanted python
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
`cf complete zsh >> .zshrc` fails on vanilla zshForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
cloudflare/cf#340 ·
I maintainer di solito rispondono entro 1 giorno