Skip to content

feat(delivery): add maximum backoff duration - #9279

Open
kahirokunn wants to merge 1 commit into
knative:mainfrom
kahirokunn:feat/delivery-backoff-max
Open

feat(delivery): add maximum backoff duration#9279
kahirokunn wants to merge 1 commit into
knative:mainfrom
kahirokunn:feat/delivery-backoff-max

Conversation

@kahirokunn

@kahirokunn kahirokunn commented Aug 21, 2026

Copy link
Copy Markdown
Member

This PR implements the Alpha stage of #9278.

TL;DR: New experimental feature allowing users to opt in to capping normal delivery retry intervals calculated from backoffDelay and backoffPolicy.

Proposed Changes

  • 🎁 Add the Alpha delivery-backoff-max feature flag, disabled by default.
  • 🎁 Extend DeliverySpec with the optional backoffMax field.
  • 🎁 Validate that backoffMax is a positive ISO 8601 duration and reject the field while the feature is disabled.
  • 🎁 Propagate backoffMax through Subscription reconciliation and Channel delivery defaults.
  • 🎁 Parse backoffMax in RetryConfigFromDeliverySpec() and apply it to linear and exponential backoff calculations.
  • 🐛 Prevent linear and exponential backoff calculations from overflowing time.Duration, including when no explicit maximum is configured.
  • 🎁 Keep delays requested through Retry-After independently controlled by retryAfterMax.
  • 🎁 Add unit and experimental E2E coverage for capped delivery retries.
  • 🎁 Update generated API documentation; user-facing documentation is tracked in DeliverySpec.BackoffMax Experimental Feature docs#6686.

Pre-review Checklist

  • At least 80% unit test coverage
  • E2E tests for any new behavior
  • Docs PR for any user-facing impact
  • Spec PR for any new API feature (Planned if the experimental feature graduates to Stable.)
  • Conformance test for any change to the spec (To be evaluated when the feature graduates to Stable.)

Release Note

The new experimental `delivery-backoff-max` feature flag lets you set `DeliverySpec.backoffMax` to cap normal retry intervals calculated from `backoffDelay` and `backoffPolicy`. The feature is disabled by default.

Docs

📖 knative/docs#6686

@knative-prow knative-prow Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. area/test-and-release Test infrastructure, tests or release labels Aug 21, 2026
@knative-prow

knative-prow Bot commented Aug 21, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kahirokunn
Once this PR has been reviewed and has the lgtm label, please assign aliok for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.09091% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.15%. Comparing base (72ec4f4) to head (93bc77a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/kncloudevents/retries.go 86.04% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9279      +/-   ##
==========================================
+ Coverage   51.06%   51.15%   +0.08%     
==========================================
  Files         411      411              
  Lines       22120    22172      +52     
==========================================
+ Hits        11295    11341      +46     
- Misses       9951     9954       +3     
- Partials      874      877       +3     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kahirokunn

Copy link
Copy Markdown
Member Author

/ok-to-test

@knative-prow knative-prow Bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Aug 21, 2026
@dsimansk

Copy link
Copy Markdown
Contributor

/ok-to-test

shouldn't be needed anymore for you as an org member :)

@kahirokunn

Copy link
Copy Markdown
Member Author

@dsimansk Thank you!
If you don't mind, could you please review this PR? 🙇‍♂️
I think backoffMax is a very basic tool that offers the essential features any valuable tool should have. 💪

Comment thread pkg/kncloudevents/retries.go
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
@kahirokunn
kahirokunn force-pushed the feat/delivery-backoff-max branch from 2f36d16 to 93bc77a Compare August 21, 2026 16:15
@dsimansk

Copy link
Copy Markdown
Contributor

@dsimansk Thank you! If you don't mind, could you please review this PR? 🙇‍♂️ I think backoffMax is a very basic tool that offers the essential features any valuable tool should have. 💪

Agreed, I've added one suggestion. Otherwise looks good, given it's feature flag guarded and well test covered.

@kahirokunn
kahirokunn requested a review from dsimansk August 21, 2026 16:16
@kahirokunn

Copy link
Copy Markdown
Member Author

@dsimansk Thanks for the suggestion, I've addressed it! Could you take another look when you get a chance? 🙏

@kahirokunn

Copy link
Copy Markdown
Member Author

/test upgrade-tests

@dsimansk

Copy link
Copy Markdown
Contributor

@Cali0707 or @creydr any change you could chime in please?

@dsimansk
dsimansk requested review from Cali0707 and removed request for evankanderson and pierDipi August 24, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/test-and-release Test infrastructure, tests or release ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants