Skip to content

fix: count exception filter and exception processor failures as callback_error, and stop dropping events when an SDK processor fails - #5688

Merged
jamescrosswell merged 4 commits into
mainfrom
fix/processor-isolation-5684
Oct 11, 2026
Merged

jamescrosswell merged 4 commits into
mainfrom
fix/processor-isolation-5684

Conversation

@jamescrosswell

@jamescrosswell jamescrosswell commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #5607, part of #5634. This covers items 3 and 4 there. They share a fix, so they're in one PR.

Summary

  • Exception filters and exception processors get the same isolation as event processors. When an IExceptionFilter or ISentryEventExceptionProcessor throws, the SDK logs an error naming it, drops the event, and records callback_error. Before, the throw fell through to CaptureEvent's catch-all. That dropped the event, logged a generic message and counted nothing.
  • A failing SDK processor no longer counts as the user's callback failing. SDK-owned event, exception and transaction processors implement a new internal ISdkProcessor marker. When one throws, the SDK logs the error and runs the remaining processors, as fix(core): [Callback Errors 3] Drop failed processor data sentry-java#6142 does. That's right for an SDK bug: the user's data isn't dropped, and the failure doesn't show up in their Stats as their own callback.

Notes for review

  • Behaviour change: since 6.12.0, a throwing SDK processor dropped the event or transaction and recorded callback_error. Now it's sent, without whatever that processor would have added.
  • The stack trace factory can be supplied by the user, and it's called from inside MainExceptionProcessor and MainSentryEventProcessor. Both calls now catch a failure there and log it. The event keeps its exception type, message and enrichment, and loses only the stack trace.
  • DelegateEventProcessor and DelegateTransactionProcessor are deliberately not marked. They wrap the user's own lambdas (scope.AddEventProcessor(Func<…>)), and a test covers this.
  • The two Entity Framework exception processors are public. Implementing an internal interface leaves their public API, and the approval snapshots, unchanged. A user subclass inherits the marker, as in Java.
  • sentry-unity's own processors aren't marked. Sentry.Unity already has InternalsVisibleTo, so it can opt in later.

Closes #5684
Closes #5685

🤖 Generated with Claude Code

…ack_error, and stop dropping events when an SDK processor fails

A throwing IExceptionFilter or ISentryEventExceptionProcessor now logs an
error naming it, drops the event and records callback_error, rather than
falling through to CaptureEvent's catch-all.

SDK-owned event, exception and transaction processors implement an
internal ISdkProcessor marker. When one throws, the error is logged and
processing continues, so an SDK bug neither drops the user's data nor
shows up in their Stats as their own callback failing.

Closes #5684
Closes #5685

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.22%. Comparing base (8973c9b) to head (f2796cf).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5688      +/-   ##
==========================================
+ Coverage   75.21%   75.22%   +0.01%     
==========================================
  Files         515      516       +1     
  Lines       18989    19022      +33     
  Branches     3693     3698       +5     
==========================================
+ Hits        14282    14310      +28     
- Misses       3852     3857       +5     
  Partials      855      855              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/Sentry/Internal/ISdkProcessor.cs Outdated
@jamescrosswell

Copy link
Copy Markdown
Collaborator Author

@ric-oliv looks like a lot to review but it's mostly just adding the marker attribute everywhere... then a few short lines checking for that marker attribute.

@jamescrosswell
jamescrosswell marked this pull request as ready for review October 7, 2026 22:45
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Oct 7, 2026
Comment thread src/Sentry/Internal/MainExceptionProcessor.cs
Comment thread src/Sentry/Internal/MainSentryEventProcessor.cs
ISentryStackTraceFactory can be user-supplied. Now that a failing SDK
processor no longer drops the event, a throw from the factory would send
an event with no SentryExceptions (MainExceptionProcessor) or without the
enricher's SDK, environment and OS/runtime context (MainSentryEventProcessor).
Catch it at both call sites, log it, and omit only the stack trace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread src/Sentry/SentryClient.cs Outdated
Comment thread test/Sentry.Tests/SentryClientTests.cs
ApplyExceptionFilters now catches only the filter call itself, logs and
records callback_error there, and reports the failure through an out
parameter. SDK code in the filtering path is no longer caught and
miscounted as the user's callback_error; it reaches CaptureEvent's
catch-all as before.

Also cover a throwing scope.AddTransactionProcessor lambda, so marking
DelegateTransactionProcessor as an SDK processor would fail a test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jamescrosswell
jamescrosswell merged commit f5891ee into main Oct 11, 2026
49 checks passed
@jamescrosswell
jamescrosswell deleted the fix/processor-isolation-5684 branch October 11, 2026 21:17
gunndabad pushed a commit to DFE-Digital/teaching-record-system that referenced this pull request Oct 21, 2026
Updated [Sentry.AspNetCore](https://github.com/getsentry/sentry-dotnet)
from 6.12.0 to 6.12.1.

<details>
<summary>Release notes</summary>

_Sourced from [Sentry.AspNetCore's
releases](https://github.com/getsentry/sentry-dotnet/releases)._

## 6.12.1

### Fixes 🐛

- fix: builds no longer fail when symbol upload or release creation is
enabled but no Sentry auth token is available by @​jamescrosswell in
[#​5705](getsentry/sentry-dotnet#5705)
- fix: count exception filter and exception processor failures as
callback_error, and stop dropping events when an SDK processor fails by
@​jamescrosswell in
[#​5688](getsentry/sentry-dotnet#5688)
- fix: SentryCreateRelease uses the assembly's informational version and
no longer requires UseSentryCLI by @​jamescrosswell in
[#​5679](getsentry/sentry-dotnet#5679)
- fix: accept breadcrumbs as {"values": [...]} when deserializing events
and transactions by @​jamescrosswell in
[#​5673](getsentry/sentry-dotnet#5673)
- fix: capturing with a configureScope callback no longer re-runs
BeforeBreadcrumb or re-syncs the scope to native SDKs by
@​jamescrosswell in
[#​5653](getsentry/sentry-dotnet#5653)
- fix: accept Unix epoch timestamps when deserializing breadcrumbs,
transactions, spans and client reports by @​jamescrosswell in
[#​5672](getsentry/sentry-dotnet#5672)

### Dependencies ⬆️

#### Deps

- chore(deps): update Java SDK to v8.60.0 by @​github-actions in
[#​5696](getsentry/sentry-dotnet#5696)
- chore(deps): update Cocoa SDK to v9.30.1 by @​github-actions in
[#​5697](getsentry/sentry-dotnet#5697)
- chore(deps): update Native SDK to v0.17.2 by @​github-actions in
[#​5680](getsentry/sentry-dotnet#5680)
- chore(deps): update Java SDK to v8.59.0 by @​github-actions in
[#​5661](getsentry/sentry-dotnet#5661)

### Other

- perf: counting discarded telemetry for client reports no longer
allocates by @​jamescrosswell in
[#​5687](getsentry/sentry-dotnet#5687)
- ci: upgrade ubuntu 20.04/22.04 runners to 24.04 by @​joshuarli in
[#​5667](getsentry/sentry-dotnet#5667)

Commits viewable in [compare
view](getsentry/sentry-dotnet@6.12.0...6.12.1).
</details>

Updated
[Sentry.Extensions.Logging](https://github.com/getsentry/sentry-dotnet)
from 6.12.0 to 6.12.1.

<details>
<summary>Release notes</summary>

_Sourced from [Sentry.Extensions.Logging's
releases](https://github.com/getsentry/sentry-dotnet/releases)._

## 6.12.1

### Fixes 🐛

- fix: builds no longer fail when symbol upload or release creation is
enabled but no Sentry auth token is available by @​jamescrosswell in
[#​5705](getsentry/sentry-dotnet#5705)
- fix: count exception filter and exception processor failures as
callback_error, and stop dropping events when an SDK processor fails by
@​jamescrosswell in
[#​5688](getsentry/sentry-dotnet#5688)
- fix: SentryCreateRelease uses the assembly's informational version and
no longer requires UseSentryCLI by @​jamescrosswell in
[#​5679](getsentry/sentry-dotnet#5679)
- fix: accept breadcrumbs as {"values": [...]} when deserializing events
and transactions by @​jamescrosswell in
[#​5673](getsentry/sentry-dotnet#5673)
- fix: capturing with a configureScope callback no longer re-runs
BeforeBreadcrumb or re-syncs the scope to native SDKs by
@​jamescrosswell in
[#​5653](getsentry/sentry-dotnet#5653)
- fix: accept Unix epoch timestamps when deserializing breadcrumbs,
transactions, spans and client reports by @​jamescrosswell in
[#​5672](getsentry/sentry-dotnet#5672)

### Dependencies ⬆️

#### Deps

- chore(deps): update Java SDK to v8.60.0 by @​github-actions in
[#​5696](getsentry/sentry-dotnet#5696)
- chore(deps): update Cocoa SDK to v9.30.1 by @​github-actions in
[#​5697](getsentry/sentry-dotnet#5697)
- chore(deps): update Native SDK to v0.17.2 by @​github-actions in
[#​5680](getsentry/sentry-dotnet#5680)
- chore(deps): update Java SDK to v8.59.0 by @​github-actions in
[#​5661](getsentry/sentry-dotnet#5661)

### Other

- perf: counting discarded telemetry for client reports no longer
allocates by @​jamescrosswell in
[#​5687](getsentry/sentry-dotnet#5687)
- ci: upgrade ubuntu 20.04/22.04 runners to 24.04 by @​joshuarli in
[#​5667](getsentry/sentry-dotnet#5667)

Commits viewable in [compare
view](getsentry/sentry-dotnet@6.12.0...6.12.1).
</details>

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't report SDK event processor failures as the user's callback_error Isolate IExceptionFilter and ISentryEventExceptionProcessor failures

2 participants