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

Alpha fixes and improvements #1319

Merged
merged 5 commits into from
Jun 19, 2023
Merged

Alpha fixes and improvements #1319

merged 5 commits into from
Jun 19, 2023

Conversation

martintmk
Copy link
Contributor

@martintmk martintmk commented Jun 19, 2023

Details on the issue fix or feature implementation

Fixes and improvements based on some testing and playing with the alpha1 package.

  • Timeout strategy disposing CancellationTokenSource too late
  • ResultFormatter not being used for resilience events.
  • The hedging should not dispose the resources it holds in background. It should do it as a post-execute action.
  • Unifying the predicate arguments, all have the same <Strategy>PredicateArguments pattern. The delegate's name is always ShouldHandle.
  • Setting default ShouldHandle callback for fallback.
  • Changing argument structs for resilience events to classes. These were boxed anyway and we can still turn the pooling later one. All these are not executed on the hot path, only when resilience event occurs.
  • Stack trace was missing for some exceptions.

Contributes to #1301

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

@martintmk martintmk added the v8 Issues related to the new version 8 of the Polly library. label Jun 19, 2023
@martintmk martintmk added this to the v8.0.0 milestone Jun 19, 2023
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.

Any tests we can add/extend to verify stack traces don't get lost?

src/Polly.Core/Utils/ExceptionUtilities.cs Outdated Show resolved Hide resolved
src/Polly.Core/Utils/ExceptionUtilities.cs Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 19, 2023

Codecov Report

Merging #1319 (d845536) into main (5c341d5) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1319   +/-   ##
=======================================
  Coverage   83.37%   83.37%           
=======================================
  Files         264      268    +4     
  Lines        6333     6335    +2     
  Branches     1001     1001           
=======================================
+ Hits         5280     5282    +2     
  Misses        844      844           
  Partials      209      209           
Flag Coverage Δ
macos 83.37% <100.00%> (+<0.01%) ⬆️
windows 83.37% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...c/Polly.Core/Utils/ReloadableResilienceStrategy.cs 100.00% <ø> (ø)
src/Polly.Core/Utils/TypeNameFormatter.cs 100.00% <ø> (ø)
...ependencyInjection/PollyDependencyInjectionKeys.cs 100.00% <ø> (ø)
...re/CircuitBreaker/CircuitBreakerStrategyOptions.cs 100.00% <100.00%> (ø)
...ircuitBreaker/Controller/CircuitStateController.cs 100.00% <100.00%> (ø)
...ly.Core/CircuitBreaker/OnCircuitClosedArguments.cs 100.00% <100.00%> (ø)
...ore/CircuitBreaker/OnCircuitHalfOpenedArguments.cs 100.00% <100.00%> (ø)
...ly.Core/CircuitBreaker/OnCircuitOpenedArguments.cs 100.00% <100.00%> (ø)
src/Polly.Core/Fallback/FallbackHandler.cs 100.00% <100.00%> (ø)
.../Polly.Core/Fallback/FallbackResilienceStrategy.cs 100.00% <100.00%> (ø)
... and 25 more

@@ -37,6 +39,7 @@ internal sealed class HedgingResilienceStrategy<T> : ResilienceStrategy

public EventInvoker<OnHedgingArguments>? OnHedging { get; }

[ExcludeFromCodeCoverage] // coverlet issue
Copy link
Member

Choose a reason for hiding this comment

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

Is there a specific issue we could link to?

Copy link
Contributor Author

@martintmk martintmk Jun 19, 2023

Choose a reason for hiding this comment

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

This one for example;
coverlet-coverage/coverlet#1284

There are more of those related to await handling

@martintmk martintmk enabled auto-merge (squash) June 19, 2023 08:14
@martintmk martintmk merged commit ce97ea5 into main Jun 19, 2023
@martintmk martintmk deleted the mtomka/alpha-fixes branch June 19, 2023 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v8 Issues related to the new version 8 of the Polly library.
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants