Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix lease not always being released #5162

Merged
merged 2 commits into from
Mar 29, 2021

Conversation

lionelvillard
Copy link
Member

Proposed Changes

  • Wait for the controller to gracefully terminate so that the lease can be properly released (when it's the leader)

Release Note

 :bug: Fix PingSource adapter not always releasing the leader election lease when terminating

Docs

@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Mar 26, 2021
@knative-prow-robot knative-prow-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 26, 2021
@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 26, 2021
@knative-metrics-robot
Copy link

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/v2/main.go 72.9% 68.9% -4.1

@codecov
Copy link

codecov bot commented Mar 26, 2021

Codecov Report

Merging #5162 (78aae2c) into main (8983fc8) will increase coverage by 0.14%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5162      +/-   ##
==========================================
+ Coverage   83.28%   83.43%   +0.14%     
==========================================
  Files         283      283              
  Lines        7947     7961      +14     
==========================================
+ Hits         6619     6642      +23     
+ Misses        956      947       -9     
  Partials      372      372              
Impacted Files Coverage Δ
pkg/adapter/v2/main.go 60.86% <100.00%> (+2.73%) ⬆️
pkg/apis/messaging/v1/subscription_defaults.go 33.33% <0.00%> (-66.67%) ⬇️
...kg/apis/messaging/v1beta1/subscription_defaults.go 33.33% <0.00%> (-66.67%) ⬇️
pkg/reconciler/pingsource/controller.go 86.20% <0.00%> (-0.89%) ⬇️
pkg/apis/messaging/v1/subscription_validation.go 81.39% <0.00%> (+1.39%) ⬆️
.../apis/messaging/v1beta1/subscription_validation.go 79.48% <0.00%> (+1.70%) ⬆️
pkg/reconciler/pingsource/pingsource.go 80.95% <0.00%> (+20.63%) ⬆️

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 8983fc8...78aae2c. Read the comment docs.

@cr22rc
Copy link
Contributor

cr22rc commented Mar 29, 2021

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 29, 2021
}
return &myAdapter{}
})
done := make(chan bool)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do this in a test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's to make sure MainWithInformers runs before view.Unregister.

}
return &myAdapter{}
})
done := make(chan bool)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do this in a test?

Copy link
Contributor

@n3wscott n3wscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 29, 2021
@knative-prow-robot knative-prow-robot merged commit 6d403f8 into knative:main Mar 29, 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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. 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.

5 participants