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

refactor: add more error information #2055

Merged
merged 1 commit into from
Aug 7, 2018

Conversation

rudyfly
Copy link
Collaborator

@rudyfly rudyfly commented Aug 6, 2018

Ⅰ. Describe what this PR did

Add more error information in quota package.

Ⅱ. Does this pull request fix one issue?

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Signed-off-by: Rudy Zhang rudyflyzhang@gmail.com

@pouchrobot pouchrobot added kind/bug This is bug report for project kind/refactor size/XL labels Aug 6, 2018
@codecov-io
Copy link

codecov-io commented Aug 6, 2018

Codecov Report

Merging #2055 into master will increase coverage by 4.89%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2055      +/-   ##
==========================================
+ Coverage   59.05%   63.95%   +4.89%     
==========================================
  Files         202      202              
  Lines       15494    15535      +41     
==========================================
+ Hits         9150     9935     +785     
+ Misses       5233     4360     -873     
- Partials     1111     1240     +129
Flag Coverage Δ
#criv1alpha1test 33.69% <0%> (-0.13%) ⬇️
#criv1alpha2test 34.2% <0%> (+2.9%) ⬆️
#integrationtest 38.47% <0%> (-0.11%) ⬇️
#unittest 22.69% <0%> (-0.07%) ⬇️
Impacted Files Coverage Δ
storage/quota/prjquota.go 8.53% <0%> (-1.12%) ⬇️
daemon/mgr/container.go 53.89% <0%> (-0.05%) ⬇️
storage/quota/grpquota.go 0% <0%> (ø) ⬆️
ctrd/image.go 79.31% <0%> (-1.98%) ⬇️
cri/v1alpha1/cri.go 65.18% <0%> (-0.18%) ⬇️
daemon/mgr/system.go 78.63% <0%> (+1.7%) ⬆️
apis/server/utils.go 66.66% <0%> (+4.76%) ⬆️
cri/v1alpha2/cri_utils.go 81.48% <0%> (+22.15%) ⬆️
cri/criservice.go 64.7% <0%> (+24.99%) ⬆️
cri/v1alpha2/cri_wrapper.go 53.87% <0%> (+53.87%) ⬆️
... and 5 more

if err != nil {
return "", err
logrus.Errorf("failed to remount grpquota, mountpoint: (%s), stdout: (%s), stderr: (%s), exit: (%d), err: (%v)",
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe errMsg := fmt.Sprintf("failed to remount grpquota, mountpoint: (%s), stdout: (%s), stderr: (%s), exit: (%d), err: (%v)", ...)

return mountPoint, err
logrus.Errorf("failed to setquota, stdout: (%s), stderr: (%s), exit: (%d), err: (%v)",
stdout, stderr, exit, err)
return mountPoint, errors.Wrapf(err, "failed to setquota, stdout: (%s), stderr: (%s), exit: (%d)")
Copy link
Contributor

Choose a reason for hiding this comment

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

missing params

Add more error information in quota package.

Signed-off-by: Rudy Zhang <rudyflyzhang@gmail.com>
@HusterWan
Copy link
Contributor

lgtm

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Aug 7, 2018
@HusterWan HusterWan merged commit 1a5b4ef into AliyunContainerService:master Aug 7, 2018
@@ -2321,7 +2321,9 @@ func (mgr *ContainerManager) setMountPointDiskQuota(ctx context.Context, c *Cont
}
err := quota.SetDiskQuota(mp.Source, size, qid)
if err != nil {
return err
// just ignore set disk quota fail
Copy link
Contributor

Choose a reason for hiding this comment

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

@rudyfly could we add reason at here, since there is no information about why we ignore the error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because of the different environment problems, setting disk quota may be failed, in order to start container successfully, so we ignore the errors that cause by diskquota's tools.

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 kind/refactor LGTM one maintainer or community participant agrees to merge the pull reuqest. size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants