Repository navigation
fix(quartz): skip Quartz's duplicate error log with UseSentry - #5836
Merged
Merged
Conversation
QuartzErrorLogFilterSetup only added its filter to SentryLoggingOptions. On version7, the ASP.NET Core, generic host, MAUI and Blazor options derive from SentryHostOptions and keep their logging options in SentryHostOptions.Logging, so the filter never reached their logger providers. A job that threw was captured twice: once by SentryScopeMiddleware, and once from Quartz's ErrorLogger entry, wrapped in a JobExecutionProcessException. The existing test didn't notice, because on version7 logging.AddSentry() sends to the global hub and not to the test's substitute. It now swaps the global hub for the substitute, and a second test runs the job through ASP.NET Core's UseSentry. The registration-count test is dropped: both behavior tests fail for every registration mutant it caught. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## version7 #5836 +/- ##
============================================
+ Coverage 76.76% 76.78% +0.01%
============================================
Files 539 539
Lines 19694 19697 +3
Branches 3851 3852 +1
============================================
+ Hits 15119 15124 +5
+ Misses 3703 3701 -2
Partials 872 872 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
bitsandfoxes
approved these changes
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On
version7, a Quartz job that throws in an ASP.NET Core or generic host app gets captured twice.Sentry.Quartzfilters out Quartz's own error log entry for an exception it has already captured. That filter only went toSentryLoggingOptions. Onversion7, the ASP.NET Core, generic host, MAUI and Blazor options derive fromSentryHostOptionsand keep their logging options inSentryHostOptions.Logging, so the filter never reached them. Every failing job sent its exception plus a second event for Quartz'sJobExecutionProcessException. The filter now goes toSentryHostOptionstoo, through its publicAddLogEntryFilter.The existing test didn't catch this. On
version7,logging.AddSentry()sends to the global hub and not to the test's substitute, so the test still passed with the filter removed completely. It now swaps the global hub for the substitute. A new test runs the job through ASP.NET Core'sUseSentry, and it fails without the fix. I dropped the test that only counted registrations, because the two behavior tests fail for every mutant it caught.Sentry.Quartz3isn't affected, because it doesn't have this filter.Sentry.Quartzhasn't shipped yet, so this needs no changelog entry.#skip-changelog