MT-Broker: return retriable status code based on the state to leverage retries#8366
Conversation
…age retries The ingress or filter deployments were returning 400 even in the case where a given resource (like trigger, broker, subscription) wasn't found, however, this is a common case where the lister cache hasn't caught up with the latest state. Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
| subscription, err := h.getSubscription(features, trigger) | ||
| if err != nil { | ||
| h.logger.Info("Unable to get the Subscription of the Trigger", zap.Error(err), zap.Any("triggerRef", triggerRef)) |
There was a problem hiding this comment.
moved behind authn feature flag as this is only needed for that
|
/cherry-pick release-1.16 |
|
/cherry-pick release-1.15 |
|
@pierDipi: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
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. |
|
@pierDipi: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
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. |
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8366 +/- ##
==========================================
- Coverage 64.27% 64.19% -0.08%
==========================================
Files 389 389
Lines 23276 23304 +28
==========================================
Hits 14961 14961
- Misses 7521 7549 +28
Partials 794 794 ☔ View full report in Codecov by Sentry. |
| writer.WriteHeader(http.StatusBadRequest) | ||
| if apierrors.IsNotFound(err) { | ||
| h.logger.Info("Unable to find the Trigger", zap.Error(err), zap.Any("triggerRef", triggerRef)) | ||
| writer.WriteHeader(http.StatusNotFound) |
| if err != nil { | ||
| h.Logger.Warn("could not get channel address from broker", zap.Error(err)) | ||
| return http.StatusBadRequest, kncloudevents.NoDuration | ||
| return http.StatusInternalServerError, kncloudevents.NoDuration |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: matzew, pierDipi 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 |
|
@pierDipi: new pull request created: #8367 DetailsIn response to this:
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. |
|
@pierDipi: #8366 failed to apply on top of branch "release-1.15": DetailsIn response to this:
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. |
…e retries (knative#8366) * MT-Broker: return appropriate status code based on the state to leverage retries The ingress or filter deployments were returning 400 even in the case where a given resource (like trigger, broker, subscription) wasn't found, however, this is a common case where the lister cache hasn't caught up with the latest state. Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Fix unit tests Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> --------- Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
…e retries (knative#8366) * MT-Broker: return appropriate status code based on the state to leverage retries The ingress or filter deployments were returning 400 even in the case where a given resource (like trigger, broker, subscription) wasn't found, however, this is a common case where the lister cache hasn't caught up with the latest state. Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Fix unit tests Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> --------- Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
…e retries (knative#8366) (#972) * MT-Broker: return appropriate status code based on the state to leverage retries The ingress or filter deployments were returning 400 even in the case where a given resource (like trigger, broker, subscription) wasn't found, however, this is a common case where the lister cache hasn't caught up with the latest state. * Fix unit tests --------- Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
The ingress or filter deployments were returning 400 even in the case where a given resource (like trigger, broker, subscription) wasn't found, however, this is a common case where the lister cache hasn't caught up with the latest state.
Fixes #
Proposed Changes
Pre-review Checklist
Release Note
Docs