Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed duplicate key exception for Hangfire jobs with AutomaticRetry #3631

Merged
merged 3 commits into from
Sep 26, 2024

Conversation

jamescrosswell
Copy link
Collaborator

@jamescrosswell jamescrosswell commented Sep 26, 2024

Resolves #3626

@bitsandfoxes I'm not super familiar with the Hangfire integration. Is this sane? My guess is that OnPerforming is being called multiple times with the same context because @vrelk-net decorated the job with [Hangfire.AutomaticRetry(Attempts = 5)]... so all OK on the first attempt but on subsequent attempts a SentryCheckInIdKey is already on the context (from the first attempt).

@bitsandfoxes bitsandfoxes enabled auto-merge (squash) September 26, 2024 13:52
Copy link
Contributor

@bitsandfoxes bitsandfoxes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this sane?

This looks correct to me!

@bitsandfoxes bitsandfoxes merged commit e94bb05 into main Sep 26, 2024
14 of 15 checks passed
@bitsandfoxes bitsandfoxes deleted the fix/hangfire-duplicate-key branch September 26, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hangfire job failures result in SentryCheckInIdKey error
2 participants