Make failure handling in EventRecorder configurable (fail-on-error option)
维护者通常 1 天内回复
已经有一个关联 PR 被合并了。
- #3688 来自 @afalhambra-hivemq —— 已合并
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 68/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- java, kubernetes
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Java
- 星标
- 945
- 派生
- 247
- 平均合并
- 2 天 10 小时
- 30 天内合并 PR
- 27
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
operator-framework/java-operator-sdk 的其他 Issue
-
Cannot record events outside reconciliation loop or for arbitrary resources (`RegisteredController#eventRecorder` missing)可能已有人在做 @afalhambra-hivemq 今天认领。 未关闭
难度 4/5 3-5 天 新手友好度 54/100
operator-framework/java-operator-sdk#3686 · 3 条评论 ·
维护者通常 1 天内回复
-
on-demand
难度 4/5 3-5 天 新手友好度 42/100
operator-framework/java-operator-sdk#3671 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 62/100
operator-framework/java-operator-sdk#3643 · 7 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
operator-framework/java-operator-sdk#3568 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
operator-framework/java-operator-sdk#3563 ·
维护者通常 1 天内回复
查看 operator-framework/java-operator-sdk 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
hiero-ledger/hiero-mirror-node#14665 ·
维护者通常 1 天内回复
-
kind/bug
难度 2/5 1-3 小时 新手友好度 65/100
cadence-workflow/cadence#8745 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
oracle/graalvm-reachability-metadata#12168 ·
维护者通常 1 天内回复
-
area/frontend area/test kind/tech-debt
难度 2/5 1-3 小时 新手友好度 82/100
camunda/camunda#69073 · 1 条评论 ·
维护者通常 1 天内回复
-
Patient profile returns a server error for a person with observation periods but no clinical records可能已有人在做 @DG47 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复