Skip to content

apiServerSource now retries sending events#5457

Merged
knative-prow-robot merged 1 commit into
knative:mainfrom
xinydev:apisource-retry
Jul 8, 2021
Merged

apiServerSource now retries sending events#5457
knative-prow-robot merged 1 commit into
knative:mainfrom
xinydev:apisource-retry

Conversation

@xinydev
Copy link
Copy Markdown
Contributor

@xinydev xinydev commented May 31, 2021

Signed-off-by: XinYang xinydev@gmail.com

Fixes #2980

Proposed Changes

  • apiServerSource now retries sending events using exponential backoff, 5 times. same as PingSource

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


Docs

@google-cla google-cla Bot added the cla: yes Indicates the PR's author has signed the CLA. label May 31, 2021
@knative-prow-robot knative-prow-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 31, 2021
@knative-prow-robot
Copy link
Copy Markdown
Contributor

Hi @xinydev. 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/test-infra repository.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2021

Codecov Report

Merging #5457 (5f798c3) into main (262b70e) will increase coverage by 0.11%.
The diff coverage is 100.00%.

❗ Current head 5f798c3 differs from pull request most recent head b129ead. Consider uploading reports for the commit b129ead to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5457      +/-   ##
==========================================
+ Coverage   82.66%   82.77%   +0.11%     
==========================================
  Files         198      197       -1     
  Lines        6171     6096      -75     
==========================================
- Hits         5101     5046      -55     
+ Misses        743      725      -18     
+ Partials      327      325       -2     
Impacted Files Coverage Δ
pkg/adapter/apiserver/events/events.go 94.44% <100.00%> (+0.07%) ⬆️
pkg/adapter/v2/cloudevents.go 83.33% <100.00%> (+1.41%) ⬆️
pkg/kncloudevents/message_sender.go 82.25% <0.00%> (-7.40%) ⬇️
pkg/apis/duck/v1/delivery_types.go 88.23% <0.00%> (-3.44%) ⬇️
pkg/apis/duck/v1beta1/delivery_types.go 88.23% <0.00%> (-2.25%) ⬇️
pkg/reconciler/broker/trigger/trigger.go 80.45% <0.00%> (-1.87%) ⬇️
pkg/adapter/mtping/pingsource.go 38.46% <0.00%> (-1.54%) ⬇️
pkg/inmemorychannel/message_dispatcher.go 88.88% <0.00%> (-1.12%) ⬇️
pkg/apis/eventing/v1/trigger_lifecycle.go 45.00% <0.00%> (-1.04%) ⬇️
pkg/apis/eventing/v1/trigger_types.go 100.00% <0.00%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 262b70e...b129ead. Read the comment docs.

@xinydev
Copy link
Copy Markdown
Contributor Author

xinydev commented May 31, 2021

/assign @matzew
/assign @lionelvillard

@pierDipi
Copy link
Copy Markdown
Member

Hi @xinydev, thanks for sending a PR, can we please add an E2E test for this new feature?

A useful (I think) example is

func SourceToSinkWithFlakyDLQ(brokerName string) *feature.Feature {

that uses the flaker test image https://github.com/knative/eventing/blob/d1106c89f7276d1e0cb804ea343f2fb7e53b9546/test/test_images/event-flaker/main.go

@xinydev xinydev marked this pull request as draft June 1, 2021 01:13
@knative-prow-robot knative-prow-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. area/test-and-release Test infrastructure, tests or release size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 1, 2021
@xinydev
Copy link
Copy Markdown
Contributor Author

xinydev commented Jun 5, 2021

/ok-to-test

@knative-prow-robot knative-prow-robot 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 Jun 5, 2021
@xinydev xinydev marked this pull request as ready for review June 5, 2021 03:23
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 5, 2021
Comment thread pkg/adapter/v2/cloudevents.go Outdated
Comment thread pkg/adapter/v2/cloudevents.go Outdated
@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 7, 2021
Comment thread test/rekt/features/apiserversource/data_plane.go Outdated
@google-cla
Copy link
Copy Markdown

google-cla Bot commented Jun 7, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@google-cla google-cla Bot added cla: no Indicates the PR's author has not signed the CLA. and removed cla: yes Indicates the PR's author has signed the CLA. labels Jun 7, 2021
@xinydev
Copy link
Copy Markdown
Contributor Author

xinydev commented Jun 7, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@benmoss Would you please check the CLA?

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Jun 7, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@xinydev
Copy link
Copy Markdown
Contributor Author

xinydev commented Jun 7, 2021

/test all

@benmoss
Copy link
Copy Markdown
Contributor

benmoss commented Jun 10, 2021

@googlebot I fixed it.

@google-cla google-cla Bot added cla: yes Indicates the PR's author has signed the CLA. and removed cla: no Indicates the PR's author has not signed the CLA. labels Jun 10, 2021
@xinydev xinydev changed the title apiServerSource now retries sending events [WIP]apiServerSource now retries sending events Jun 16, 2021
@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 16, 2021
Signed-off-by: XinYang <xinydev@gmail.com>
@knative-metrics-robot
Copy link
Copy Markdown

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

File Old Coverage New Coverage Delta
pkg/adapter/apiserver/events/events.go 96.4% 96.5% 0.1

@xinydev xinydev changed the title [WIP]apiServerSource now retries sending events apiServerSource now retries sending events Jul 8, 2021
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 8, 2021
@xinydev
Copy link
Copy Markdown
Contributor Author

xinydev commented Jul 8, 2021

/hold cancel

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 8, 2021
@xinydev xinydev requested a review from lionelvillard July 8, 2021 12:54
@lionelvillard
Copy link
Copy Markdown
Contributor

/lgtm
/approve

Thanks!

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 8, 2021
@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lionelvillard, xinydev

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

The pull request process is described 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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 8, 2021
@knative-prow-robot knative-prow-robot merged commit 221dfdf into knative:main Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test-and-release Test infrastructure, tests or release cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

APIServerSource adapter should retry sending events

8 participants