Make failure handling in EventRecorder configurable (fail-on-error option)
I maintainer di solito rispondono entro 1 giorno
Una pull request collegata è già stata integrata.
- #3688 di @afalhambra-hivemq — integrata
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- java, kubernetes
- Ambito
- backend, distributed-systems
Direzione di ricerca
Start by locating DefaultEventRecorder#record and the EventSink#emit call described in the issue. Read the recorder's existing tests and identify how its construction or configuration is covered. Add an opt-in fail-on-error setting while preserving the current default, then verify that enabled failures propagate and disabled failures remain logged and swallowed.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem? Please describe.
Currently, DefaultEventRecorder#record treats recording strictly as "best effort": any exception thrown when writing to the API server via EventSink#emit is logged as a warning and swallowed:
try {
sink.emit(toEvent(context, event), context);
} catch (Exception e) {
// recording an event must never break the caller: a controller that fails to reconcile
// because it could not write an event is strictly worse than one that records nothing
log.warn("Could not record {} event ...", ...);
}
While swallowing errors is desirable for informational telemetry, in our use case (and in environments with strict audit, compliance, or state tracking requirements), emitting a Kubernetes Event is considered part of the required reconciliation side-effects. If the event cannot be persisted (e.g. due to RBAC issues, network partition, or API server failure), continuing reconciliation without failing leaves the cluster in an inconsistent or un-audited state. We want the reconciliation to fail and re-queue/retry when an event fails to be recorded.
Describe the solution you'd like
Make this behavior configurable. When enabled, failures to record an event should propagate as an exception to trigger standard error handling and reconciliation retries, while keeping the current non-failing behavior as the default.
Describe alternatives you've considered
Extending DefaultEventRecorder and overriding the record method. However, this is not clean because it requires duplicating framework logic (such as parameter validation and calling toEvent(...) / sink.emit(...)) just to bypass the try-catch block.
Additional context
None
- Lingua principale
- Java
- Stelle
- 945
- Fork
- 247
- Merge medio
- 2g 10h
- PR unite (30g)
- 27
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun 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 operator-framework/java-operator-sdk
-
Cannot record events outside reconciliation loop or for arbitrary resources (`RegisteredController#eventRecorder` missing)Forse già presa @afalhambra-hivemq l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 54/100
operator-framework/java-operator-sdk#3686 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
on-demand
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
operator-framework/java-operator-sdk#3671 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 62/100
operator-framework/java-operator-sdk#3643 · 7 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
operator-framework/java-operator-sdk#3568 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
operator-framework/java-operator-sdk#3563 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di operator-framework/java-operator-sdk
Issue simili
-
ImporterNoConsensus and ImporterFileVerificationErrors alerts can't fire on consensus failureApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
hiero-ledger/hiero-mirror-node#14665 ·
I maintainer di solito rispondono entro 1 giorno
-
kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
cadence-workflow/cadence#8745 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
oracle/graalvm-reachability-metadata#12168 ·
I maintainer di solito rispondono entro 1 giorno
-
area/frontend area/test kind/tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
camunda/camunda#69073 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Patient profile returns a server error for a person with observation periods but no clinical recordsForse già presa @DG47 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno