Repository navigation
fix(trigger): track the subscriber with the Trigger as observer - #9509
Conversation
The MT broker Trigger reconciler resolved the subscriber with the Broker as the tracker parent. The tracker then recorded <namespace>/<broker-name> as the observer, and since the tracker callback enqueues into the Trigger work queue, a change to the subscriber enqueued a Trigger key that does not exist instead of the Trigger itself. As a result the Trigger was not reconciled when its subscriber became addressable or changed its address, and the broker filter kept using the stale status.subscriberUri, CA certs and audience until another event or a resync reconciled the Trigger. Pass the Trigger as the parent, as is already done for the Trigger's dead letter sink. Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
|
Welcome @lbarrosby! It looks like this is your first PR to knative/eventing 🎉 |
|
Hi @lbarrosby. 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 Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9509 +/- ##
=======================================
Coverage 51.33% 51.34%
=======================================
Files 411 411
Lines 22187 22187
=======================================
+ Hits 11389 11391 +2
+ Misses 9916 9915 -1
+ Partials 882 881 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/ok-to-test |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Cali0707, lbarrosby The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
Related to #5374 (closed without a root cause; same symptom: a Trigger is not re-reconciled when its subscriber becomes ready).
The MT broker Trigger reconciler resolves the subscriber with the Broker as the tracker parent:
The tracker records the parent as the observer, so it stores
<namespace>/<broker-name>. The tracker callback is the Trigger controller'sEnqueueKey, so when the subscriber changes, the Trigger work queue gets a key for a Trigger that does not exist (or for an unrelated Trigger that happens to share the Broker's name), and the real Trigger is not reconciled.The broker filter dispatches to
status.subscriberUri,status.subscriberCACertsandstatus.subscriberAudience, so this matters beyond readiness:Every other
AddressableFromDestinationV1call inpkg/reconcilerpasses the object being reconciled, including the Trigger's own dead letter sink a few lines below.Proposed Changes
Pre-review Checklist
Testing
TestReconcileTracksSubscriberForTriggerreconciles a Trigger whose subscriber does not exist yet, using a real tracker, and checks the observers recorded for the subscriber. On main it fails withtest-namespace/test-brokeras the observer; with the fix it istest-namespace/test-trigger.go test ./pkg/reconciler/broker/...,go vetandgolangci-linton the package pass.Release Note
Docs
AI disclosure: written with the help of Claude Code, reviewed and tested by me.