Copy job history to avoid InvalidOperationException#47
Merged
perrich merged 1 commit intoperrich:masterfrom Jun 14, 2025
martincostello:copy-job-history
Merged
Copy job history to avoid InvalidOperationException#47perrich merged 1 commit intoperrich:masterfrom martincostello:copy-job-history
perrich merged 1 commit intoperrich:masterfrom
martincostello:copy-job-history
Conversation
Copy job history from storage before returning to avoid mutating state.
There was a problem hiding this comment.
Pull Request Overview
This pull request copies the job history before returning it to prevent state mutations and avoid an InvalidOperationException.
- Clone the job History using ToList() to ensure subsequent modifications do not affect the stored state.
- Maintain the existing object properties while addressing the failing test.
4 tasks
Owner
|
Thank you for the fix. |
Contributor
Author
|
@perrich Could we get a new release with this change included published to NuGet.org please? We still get the issue pop-up in our CI in https://github.com/open-telemetry/opentelemetry-dotnet-contrib from time to time. |
Contributor
Author
|
Nevermind, I see 1.8.1.2 in NuGet contains this change, there just wasn't a corresponding GitHub release. |
martincostello
added a commit
to open-telemetry/opentelemetry-dotnet-contrib
that referenced
this pull request
Aug 15, 2025
Update dependencies in tests to their latest versions, mainly to pick up the fix from perrich/Hangfire.MemoryStorage#47.
4 tasks
martincostello
added a commit
to open-telemetry/opentelemetry-dotnet-contrib
that referenced
this pull request
Aug 17, 2025
Update dependencies in tests to their latest versions, mainly to pick up the fix from perrich/Hangfire.MemoryStorage#47.
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.
Copy job history from storage before returning to avoid mutating state.
Surfaced via a failing test in open-telemetry/opentelemetry-dotnet-contrib.
Avoiding for now via open-telemetry/opentelemetry-dotnet-contrib#2835.