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

Hedging strategy also deep-copies context for primary execution #1754

Merged
merged 4 commits into from
Oct 30, 2023

Conversation

martintmk
Copy link
Contributor

@martintmk martintmk commented Oct 30, 2023

Pull Request

The issue or feature being addressed

#1727

Details on the issue fix or feature implementation

As per #1727 there was inconsistency on how the hedging contexts for primary executions are handled. Instead of creating deep-clone, the hedging strategy re-used the original context.

With this change, the handling is the same for both primary and hedged actions. Hedging strategy always creates a deep clone in all scenarios.

This also simplifies the implementation and handling of contexts. 

Confirm the following

  • I started this PR by branching from the head of the default branch
  • I have targeted the PR to merge into the default branch
  • I have included unit tests for the issue/feature
  • I have successfully run a local build

Copy link
Member

@martincostello martincostello left a comment

Choose a reason for hiding this comment

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

Is there any impact to benchmarks (+ve or -ve) from this change?

@martintmk
Copy link
Contributor Author

Is there any impact to benchmarks (+ve or -ve) from this change?

I don't think so, but let me re-run just in case.

@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (41d4e8d) 84.56% compared to head (c7c97e1) 84.52%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1754      +/-   ##
==========================================
- Coverage   84.56%   84.52%   -0.05%     
==========================================
  Files         307      306       -1     
  Lines        6790     6772      -18     
  Branches     1043     1042       -1     
==========================================
- Hits         5742     5724      -18     
  Misses        839      839              
  Partials      209      209              
Flag Coverage Δ
linux 84.52% <100.00%> (-0.05%) ⬇️
macos 84.52% <100.00%> (-0.05%) ⬇️
windows ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...Core/Hedging/Controller/HedgingExecutionContext.cs 100.00% <100.00%> (ø)
src/Polly.Core/Hedging/Controller/TaskExecution.cs 100.00% <100.00%> (ø)
src/Polly.Core/ResilienceContext.cs 100.00% <100.00%> (ø)
src/Polly.Core/ResilienceProperties.cs 100.00% <ø> (ø)

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

@martintmk martintmk enabled auto-merge (squash) October 30, 2023 11:38
@martintmk martintmk merged commit 2cbe4f0 into main Oct 30, 2023
14 checks passed
@martintmk martintmk deleted the mtomka/unify-hedging-context branch October 30, 2023 12:07
@martincostello
Copy link
Member

@martintmk Would you consider this change to be a patch or a minor change?

If we take the change for AoT too, then can that be 8.0.1 or does this change make it 8.1.0?

I'm thinking 8.0.1, but if you consider this minor rather than patch then we can do an 8.1.0 and the .NET 8 release will become 8.2.0.

@martintmk
Copy link
Contributor Author

We had some API additions in #1687 so I would say we should do 8.1.0.

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.

2 participants