Merged
Conversation
This PR implements Distributed Deadline Propagation as specified in issue #44. It adds mechanisms to propagate context deadlines to downstream services and provides early abort functionality for requests with insufficient remaining time. - **MinDeadlineThreshold**: Added configuration to `Config` and `Option` to define a minimum threshold for starting an attempt. - **Deadline Middleware**: Implemented `deadlineMiddleware` that checks the remaining context time and returns `context.DeadlineExceeded` if below the threshold. - **Header Injection**: Added `InjectDeadlineHeader` in `propagation.go` with support for both standard integer milliseconds and gRPC-compatible timeout formatting. - **Terminal Errors**: Updated `shouldRetry` to treat `context.DeadlineExceeded` and `context.Canceled` as terminal errors. - **Example**: Added `examples/deadline/main.go` demonstrating the feature. - Added comprehensive unit tests in `deadline_propagation_test.go` covering early abort, dynamic recalculation, and header injection. - Verified all tests pass with >90% coverage in the core package. - Manually verified the behavior using the new example. fixes #44
…r, and issue-loop-manager
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #54 +/- ##
==========================================
- Coverage 91.86% 91.79% -0.08%
==========================================
Files 13 14 +1
Lines 897 938 +41
==========================================
+ Hits 824 861 +37
- Misses 45 47 +2
- Partials 28 30 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
This PR updates the project guidelines and agent instructions to strictly require GPG signatures for all commits, ensuring higher security and authenticity for the codebase.