Skip to content

fix(channel): record the subscriber's status, not the dead letter sink's - #9612

Open
RajPrakash681 wants to merge 3 commits into
knative:mainfrom
RajPrakash681:fix/imc-dls-status
Open

RajPrakash681 wants to merge 3 commits into
knative:mainfrom
RajPrakash681:fix/imc-dls-status

Conversation

@RajPrakash681

@RajPrakash681 RajPrakash681 commented Nov 21, 2026 •

Copy link
Copy Markdown

Fixes #9611

Proposed Changes

  • 🐛 When delivery to the subscriber (or the reply) fails and the event goes to the dead letter sink, Dispatcher.SendEvent and SendMessage now return the DispatchInfo of the failed request instead of the dead letter sink's. The InMemoryChannel kn.eventing.dispatch.duration series for the Subscription then records the failed request's status code and duration, as it already does when there is no dead letter sink.
  • Only the channel fanout passes a dead letter sink to kncloudevents.Dispatcher, so the Broker and request-reply are unchanged. The dead letter sink's request still shows in http.client.request.duration.
  • Tested with unit tests and on Eventing 1.24.0: for 10 events to a subscriber that answers 405, with a dead letter sink that answers 202, the subscription: series went from 10 × 202 to 10 × 405.
  • Each kn.eventing.dispatch.duration sample sets its own Subscription's response status instead of adding it to the shared request labeler, so parallel deliveries keep their own status. A request that fails before timing starts, such as an OIDC token failure, records no sample (from @kahirokunn).

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
  • Conformance test for any change to the spec

Release Note

InMemoryChannel dispatch metrics now record the status code and duration of the failed request to the subscriber (or the reply) when the event goes to the dead letter sink, instead of the dead letter sink's.

Docs

None needed.

@knative-prow knative-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 21, 2026
@knative-prow

knative-prow Bot commented Nov 21, 2026

Copy link
Copy Markdown

Hi @RajPrakash681. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@knative-prow
knative-prow Bot requested review from Leo6Leo and creydr November 21, 2026 19:27
@knative-prow

knative-prow Bot commented Nov 21, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: RajPrakash681
Once this PR has been reviewed and has the lgtm label, please assign leo6leo 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

Signed-off-by: RajPrakash681 <rjnt452@gmail.com>
@kahirokunn

Copy link
Copy Markdown
Member

/ok-to-test

@knative-prow knative-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 22, 2026
@codecov

codecov Bot commented Nov 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.33%. Comparing base (f819a05) to head (23c6925).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9612      +/-   ##
==========================================
- Coverage   51.33%   51.33%   -0.01%     
==========================================
  Files         412      412              
  Lines       22189    22189              
==========================================
- Hits        11391    11390       -1     
- Misses       9917     9920       +3     
+ Partials      881      879       -2     

☔ 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.

Signed-off-by: kahirokunn <okinakahiro@gmail.com>
@kahirokunn

Copy link
Copy Markdown
Member

@RajPrakash681 Hi ✋ PTAL. RajPrakash681#1 Thank you 🙏

Signed-off-by: RajPrakash681 <rjnt452@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InMemoryChannel dispatch metric records the dead letter sink's response instead of the subscriber's

2 participants