[Bug]: Beam engine: a transform error that is not thrown (setErrors/stopAll) does not fail the pipeline
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 83/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- java
- Ambito
- backend, distributed-systems
Direzione di ricerca
Leggi plugins/engines/beam/.../core/transform/TransformFn.java, in particolare emptyRowBuffer e il controllo degli errori esistente in iterate. Confronta il modo in cui oneIteration() segnala gli errori di trasformazione, quindi esegui i test del motore Beam che coprono gli errori di trasformazione. Il lavoro è completato quando un errore registrato tramite setErrors fa fallire la pipeline Beam invece di farla terminare con successo con righe perse.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Apache Hop version?
2.19.0 (the same code is on main)
Java version?
21
Operating system
Linux
What happened?
On the Beam engine (Spark runner, local master; the Direct runner behaves the same), a transform that fails by recording an error instead of throwing does not fail the pipeline. The run ends as succeeded and the error only appears in the log.
Example with the REST client transform: method POST, "Retry times" 0, retry status codes 400-599. The server answers 400 on the 6th row. Rest.processRow catches the HopException ("Request failed after retries, status: 400"), calls setErrors(1) and stopAll(), and returns false (Rest.java, around line 2162). On the local engine the same pipeline fails, as expected. On the Beam engine it finishes as succeeded with 5 rows written.
Cause: in plugins/engines/beam/.../core/transform/TransformFn.java, the per-element path processElement -> emptyRowBuffer calls executor.oneIteration() and checks neither its result nor the error count:
// Execute all transforms in the transformation
//
executor.oneIteration();
outputResults(context);
SingleThreadedPipelineExecutor.oneIteration() returns false when a transform has errors, but this is ignored. The two other call sites in the same class already check it:
private void iterate(TupleOutputContext<HopRow> output) throws HopException {
executor.oneIteration();
if (executor.getErrors() > 0) {
throw new HopException("Transform '" + transformName + "' failed");
}
outputResults(output);
}
Proposed fix: apply the same check in emptyRowBuffer, so that the exception reaches the catch in processElement, the TransformProcessErrors counter is incremented and the Beam job fails:
executor.oneIteration();
if (executor.getErrors() > 0) {
throw new HopException("Transform '" + transformName + "' failed");
}
outputResults(context);
This affects every transform that follows the usual logError / setErrors(1) / stopAll() pattern without error handling, not only REST: on the Beam engine its failures are silent, and rows can be lost.
Issue Priority
Priority: 2
Issue Component
Component: Beam
- Lingua principale
- Java
- Stelle
- 1.6k
- Fork
- 499
- Merge medio
- 1g 5h
- PR unite (30g)
- 316
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la 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 apache/hop
-
awaiting triage Hop Gui P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
apache/hop#9325 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
awaiting triage Documentation P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
awaiting triage Documentation P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
awaiting triage Documentation P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
awaiting triage Documentation P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
Card-Forge/forge#13128 ·
I maintainer di solito rispondono entro 1 giorno
-
client documentation
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
ClickHouse/clickhouse-java#3469 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/flink-agents#1480 ·
I maintainer di solito rispondono entro 2 giorni