Phase 8.1: Implement Timeout Policies and Resilience Testing#154
Merged
Phase 8.1: Implement Timeout Policies and Resilience Testing#154
Conversation
- Add configurable timeout values for HTTP, database, and broker operations - Support pessimistic and optimistic timeout strategies - Provide TimeSpan properties for easy policy integration Related to #109
- Create timeout policies for HTTP, database, and broker operations - Support both pessimistic and optimistic timeout strategies - Add comprehensive logging for timeout events - Include timeout duration and strategy in logs Related to #109
- Add CreateCompleteHttpResiliencePolicy with timeout + circuit breaker + retry - Add CreateCompleteDatabaseResiliencePolicy with full policy stack - Add CreateCompleteBrokerResiliencePolicy with timeout support - Maintain existing two-layer policies for backward compatibility - Wrap policies in correct order: Timeout (outer) -> Circuit Breaker -> Retry (inner) Related to #109
- Add Resilience:Timeout section with HTTP, database, and broker timeouts - Configure pessimistic timeout strategy as default - Set appropriate timeout values: HTTP 30s, Database 10s, Broker 5s Related to #109
- Register TimeoutConfiguration from appsettings - Add complete wrapped policies with timeout + circuit breaker + retry - Maintain backward compatibility with existing two-layer policies - Update HTTP resilience policy factory to support complete policies Related to #109
- Add tests for retry on transient failures - Add tests for circuit breaker opening after threshold - Add tests for timeout on slow operations - Add tests for combined policy interaction - Use WebApplicationFactory for integration testing Related to #109
- Add database intermittent failures scenario (30% failure rate) - Add database prolonged outage scenario - Add broker slow responses scenario - Add network partition simulation - Add high load with varying failure rates - Measure success rates and performance impact Related to #109
- Add baseline benchmark without policies - Add benchmarks for individual policies (retry, circuit breaker, timeout) - Add benchmark for complete policy stack - Use BenchmarkDotNet with memory diagnostics - Measure overhead for each resilience layer Related to #109
- Document all implemented resilience policies - Explain timeout, retry, and circuit breaker patterns - Describe policy combination and wrapping order - Provide configuration examples - Add monitoring and health check information - Include testing strategy overview Related to #109
- For HTTP, wrap timeout with ExecuteAsync delegate pattern - Use Policy.WrapAsync only for typed policies (circuit breaker + retry) - Apply timeout as outer wrapper around the wrapped policy - Maintain correct wrapping order: timeout -> circuit breaker -> retry Fixes build error CS1503
- Register CompleteHttpResiliencePolicy instead of AsyncPolicyWrap<HttpResponseMessage> - Update factory to return the new wrapper type - Maintain correct usage pattern for HTTP resilience with timeout Related to #109
13 tasks
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.
Description
Implements comprehensive timeout policies and resilience testing for Phase 8.1.
Changes
Core Implementation
Testing
Documentation
Policy Wrapping Order
Timeout (outer) → Circuit Breaker → Retry (inner) → Operation
Acceptance Criteria
Closes #109