Add opt-in strict callback mode
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
研究方向
Read the callback error isolation spec and review the closed draft in #6173, especially its open review points and the callback error paths it describes. Map the SDK option and external configuration entry points, then trace how callback failures reach capture and integration code. Done means strict mode propagates callback failures as specified while excluding the failed callback from reporting, with normal mode preserving isolation; the issue does not identify specific source files or tests.
由索引模型根據 Issue 內容生成。
描述
The SDK isolates failures in user callbacks (beforeSend*, beforeBreadcrumb, samplers, event processors, etc.): the error is logged, the data is dropped, and a callback_error client report is recorded (#6081, released in 8.61.0). There is currently no way to make those failures surface, which makes buggy callbacks hard to notice and debug during development.
The callback error isolation spec (getsentry/sentry-docs#19189) allows an opt-in strict mode:
- MAY offer it, disabled by default.
- In strict mode, a callback failure MUST propagate as an unhandled error of the host application instead of being isolated.
- The event reporting that error MUST NOT go through the callback that failed.
- Any callback failure while processing that event, or data created while reporting it (e.g. breadcrumbs), MUST be isolated instead of propagated.
Outside strict mode, the SDK MUST NOT re-throw or capture callback errors as events.
Prior attempt
A draft implementation was closed unmerged as not ready: #6173 (branch feat/strict-callback-mode, built on the callback-errors stack starting at #6140). It added a strictCallbackMode option (default off) with:
- Callback failures wrapped in marker exceptions/errors with the original failure as cause, propagated via
ExceptionUtils.maybeRethrow()before logging or discard accounting, including enclosing SDK catches and async completion paths. - Events containing a callback marker (incl. nested/cyclic causes and
ExceptionMechanismException) silently excluded before capture callbacks, processors, logging, or discard accounting; same exclusion in the JUL, Logback, Log4j2, and Timber integrations. - Async failures following the host API's behavior (returned futures keep the failure; the SDK does not terminate the process).
- Config via SDK options,
strict-callback-modeexternal config,io.sentry.strict-callback-modeAndroid manifest metadata, andsentry.strict-callback-modeSpring Boot property.
Open points from review on #6173:
- Design of
CallbackUtils. - Some code paths started throwing where they previously swallowed exceptions independent of the flag, which would be a breaking change for a minor.
- Marker logging during uncaught-exception capture, feedback dismiss-listener cleanup, and proxy-only Log4j2 events.
Related: #5513 (stop catching non-recoverable Throwables in the next major) is a separate, broader change.
Shipping behind the flag in a minor and possibly flipping the default in a major was floated as an option.
via alexander.dinauer.
--
- 主要語言
- Kotlin
- 星號
- 1.4k
- 分支
- 483
- 平均合併
- 2 天 54 分鐘
- 30 天內合併 PR
- 207
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
getsentry/sentry-java 的其他 Issue
-
Test the `sentry wizard` Android port可能已有人在做 @antonis 於 1 天前認領。 未關閉Platform: Java
getsentry/sentry-java#6797 · 1 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
Narrow and clean up Android consumer keep rules可能已有人在做 @runningcode 於 3 天前認領。 未關閉Android Platform: Java
getsentry/sentry-java#6771 · 1 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
Android Bug Platform: Java Waiting for: Product Owner
難度 4/5 3-5 天 新手友好度 45/100
getsentry/sentry-java#6758 · 4 則留言 ·
維護者通常 1 天內回覆
-
Android Bug Platform: Java Replays
難度 3/5 1-2 天 新手友好度 62/100
getsentry/sentry-java#6741 · 1 則留言 ·
維護者通常 1 天內回覆
-
Android Bug Platform: Java Replays
難度 3/5 1-2 天 新手友好度 50/100
getsentry/sentry-java#6740 · 1 則留言 ·
維護者通常 1 天內回覆
查看 getsentry/sentry-java 的全部 Issue
相似的 Issue
-
enhancement
難度 2/5 1-3 小時 新手友好度 62/100
IacobIonut01/ReFra#1515 · 1 則留言 ·
維護者通常 4 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
openwatersio/slackwater-android#162 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 半天 新手友好度 72/100
developmentwithyash/yaan#184 ·
維護者通常 1 天內回覆
-
analytics
難度 2/5 1-3 小時 新手友好度 62/100
-
🐛 Type:Bug 📏 Size: S 🔧 State:In Progress 🔹 Priority: P2 - Medium
難度 2/5 1-3 小時 新手友好度 70/100
yeliqin666/xjtu-toolbox-android#623 · 1 則留言 ·