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

bugfix: fix lease used by pouchd may be expired #2820

Merged

Conversation

HusterWan
Copy link
Contributor

Signed-off-by: Michael Wan zirenwan@gmail.com

Ⅰ. Describe what this PR did

In containerd 1.2.5 WithLease add a default expire time, so when pouchd starting, it will got a lease with expire time, so the pouchd will got errors calling containerd API when the lease expired.

image

So we create a named lease that is pouchd.lease. when pouchd starting , we just fetch the named lease and make sure the lease do not have expire label.

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Signed-off-by: Michael Wan <zirenwan@gmail.com>
@pouchrobot pouchrobot added kind/bug This is bug report for project size/L labels Apr 30, 2019
@codecov
Copy link

codecov bot commented Apr 30, 2019

Codecov Report

Merging #2820 into master will decrease coverage by 1.42%.
The diff coverage is 39.39%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2820      +/-   ##
==========================================
- Coverage   69.34%   67.92%   -1.43%     
==========================================
  Files         278      278              
  Lines       17428    17448      +20     
==========================================
- Hits        12085    11851     -234     
- Misses       3994     4247     +253     
- Partials     1349     1350       +1
Flag Coverage Δ
#criv1alpha2_test 39.3% <39.39%> (+0.07%) ⬆️
#integration_test_0 23.5% <ø> (-13.06%) ⬇️
#integration_test_1 35.32% <39.39%> (-0.02%) ⬇️
#integration_test_2 36.5% <39.39%> (-0.04%) ⬇️
#integration_test_3 35.38% <39.39%> (ø) ⬆️
#node_e2e_test 35.06% <39.39%> (+0.06%) ⬆️
#unittest 28.74% <0%> (-0.04%) ⬇️
Impacted Files Coverage Δ
ctrd/wrapper_client.go 84.61% <100%> (+6.83%) ⬆️
ctrd/client.go 64.65% <35.48%> (-6.71%) ⬇️
hookplugins/containerplugin/update_hook.go 0% <0%> (-100%) ⬇️
daemon/mgr/container_upgrade.go 0% <0%> (-65.1%) ⬇️
storage/plugins/plugins.go 25% <0%> (-25%) ⬇️
pkg/utils/random_string.go 63.63% <0%> (-18.19%) ⬇️
daemon/mgr/container_envs.go 0% <0%> (-15.79%) ⬇️
storage/volume/driver/remote.go 51.78% <0%> (-14.29%) ⬇️
daemon/mgr/container_logs.go 68.75% <0%> (-13.75%) ⬇️
daemon/mgr/spec_linux.go 65.83% <0%> (-13.17%) ⬇️
... and 26 more

Copy link
Contributor

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

@fuweid fuweid merged commit f297432 into AliyunContainerService:master Apr 30, 2019
@@ -86,8 +90,13 @@ func NewClient(opts ...ClientOpt) (APIClient, error) {
insecureRegistries: copts.insecureRegistries,
}

lease, err := client.preparePouchdLease(copts.rpcAddr, copts.defaultns)
if err != nil {
return nil, fmt.Errorf("failed to prepare a lease for pouchd")
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not to print the detailed err in the returned err? @HusterWan @fuweid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is bug report for project size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants