Skip to content
This repository has been archived by the owner on Jun 4, 2021. It is now read-only.

Don't advance the consumer group when events can't be delivered. #1030

Merged

Conversation

evankanderson
Copy link
Member

Fixes reported issue in #eventing

We shouldn't advance a consumer group in Kafka until the downstream has accepted it, or we may drop events.

NOTE: no tests seemed to cover this case. I'm happy to try adding a test in a bit, but Alejandro Saucedo in slack wanted to see the change.

Proposed Changes

  • Handle() is supposed to return true only when the message has been successfully delivered, but the channel hard-wired it to always return true, even if the delivery returned an error (failure).

Release Note

- 🐛 🧽 Fixed a case where the Kafka channel could drop messages if the recipient was unavailable.

Docs

No documentation changes needed, as the intended behavior of the Kafka channel was to not drop messages.

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Mar 16, 2020
@knative-prow-robot knative-prow-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 16, 2020
@evankanderson
Copy link
Member Author

Note that the source doesn't have the same problem, because it does substantial error-checking:

https://github.com/knative/eventing-contrib/blob/master/kafka/source/pkg/adapter/adapter.go#L168

@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-eventing-contrib-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
kafka/channel/pkg/dispatcher/dispatcher.go 66.7% 66.2% -0.4

@n3wscott
Copy link
Contributor

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 16, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: evankanderson, n3wscott

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

The pull request process is described here

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

@knative-prow-robot knative-prow-robot merged commit 98d2c01 into knative:master Mar 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants