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

daemon: replace error with warning message when synchronize snapshot update #2629

Merged

Conversation

chuanchang
Copy link
Contributor

@chuanchang chuanchang commented Dec 28, 2018

The Sync() is an loop function, which will collect usage of snapshot util
success, it means there are many error message will be written into log
if it's failed to get usage for snapshot, these error will be easy to
trigger a monitor tool, so replace writing error with warning into log.

Signed-off-by: Alex Jia chuanchang.jia@gmail.com

Ⅰ. Describe what this PR did

Ⅱ. 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

e.g.

time="2018-12-28T06:14:25.311286459+08:00" level=error msg="failed to get usage for snapshot "0781c8f0ccb03a1341fb715a7ba6e615308bcf584ccd37e47efef4a73da03034":lstat /home/t4/pouch/containerd/root/io.containerd.snapshotter.v1.overlayfs/snapshots/6904/fs/usr/local/ilogtail/snapshot/ilogtail_status.LOG.44: no such file or directory: not found"
time="2018-12-28T07:07:31.03424663+08:00" level=error msg="failed to get usage for snapshot "fb280451f04f57d476838b718c520f68f1d834669eb91cb9b8f6c53fa6384455": lstat /home/t4/pouch/containerd/root/io.containerd.snapshotter.v1.overlayfs/snapshots/8181/fs/usr/local/ilogtail/snapshot/ilogtail_status.LOG.12: no such file ordirectory: not found"
time="2018-12-28T08:12:55.321965671+08:00" level=error msg="failed to get usage for snapshot "2340109eab02355a7738a761284af455b00db33813fbe635e1b1e6b212a3025a":lstat /home/t4/pouch/containerd/root/io.containerd.snapshotter.v1.overlayfs/snapshots/7962/fs/usr/local/ilogtail/snapshot/ilogtail_status.LOG.39: no such file or directory: not found"
time="2018-12-28T08:59:20.510390419+08:00" level=error msg="failed to get usage for snapshot "7de2a771e56621b6904d38cd99359bf9972e25c5e824e44921e1c03932cc1faf":lstat /home/t4/pouch/containerd/root/io.containerd.snapshotter.v1.overlayfs/snapshots/7938/fs/usr/local/ilogtail/snapshot/ilogtail_status.LOG.43: no such file or directory: not found"
time="2018-12-28T09:29:30.133803579+08:00" level=error msg="failed to get usage for snapshot "947431cc154292676ebaeb003070d0ea9656a25ec846bd5deb5fb81642d03910":lstat /home/t4/pouch/containerd/root/io.containerd.snapshotter.v1.overlayfs/snapshots/4922/fs/tmp/logtail_check_point.bak: no such file or directory: not found"
time="2018-12-28T10:10:55.484146651+08:00" level=error msg="failed to get usage for snapshot "2340109eab02355a7738a761284af455b00db33813fbe635e1b1e6b212a3025a":lstat /home/t4/pouch/containerd/root/io.containerd.snapshotter.v1.overlayfs/snapshots/7962/fs/usr/local/ilogtail/snapshot/ilogtail_status.LOG.41: no such file or directory: not found"

@codecov
Copy link

codecov bot commented Dec 28, 2018

Codecov Report

Merging #2629 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2629      +/-   ##
=========================================
- Coverage    69.5%   69.5%   -0.01%     
=========================================
  Files         280     280              
  Lines       18844   18844              
=========================================
- Hits        13098   13097       -1     
+ Misses       4279    4278       -1     
- Partials     1467    1469       +2
Flag Coverage Δ
#criv1alpha1test 31.36% <0%> (ø) ⬆️
#criv1alpha2test 35.66% <0%> (ø) ⬆️
#integrationtest 41.68% <0%> (+0.01%) ⬆️
#nodee2etest 32.68% <0%> (-0.03%) ⬇️
#unittest 26.91% <0%> (ø) ⬆️
Impacted Files Coverage Δ
daemon/mgr/snapshot.go 33.33% <0%> (ø) ⬆️
cri/ocicni/cni_manager.go 58.82% <0%> (-11.77%) ⬇️
ctrd/container.go 58.1% <0%> (-0.8%) ⬇️
cri/v1alpha2/cri.go 67.69% <0%> (-0.13%) ⬇️
cri/v1alpha2/cri_wrapper.go 66.8% <0%> (+1.2%) ⬆️
ctrd/image.go 78.18% <0%> (+2.27%) ⬆️
apis/server/utils.go 75% <0%> (+3.84%) ⬆️

@pouchrobot pouchrobot added kind/bug This is bug report for project size/XS labels Dec 28, 2018
The Sync() is an loop function, which will collect usage of snapshot util
success, it means there are many error message will be written into log
if it's failed to get usage for snapshot, these error will be easy to
trigger a monitor tool, so replace writing error with warning into log.

Signed-off-by: Alex Jia <chuanchang.jia@gmail.com>
@chuanchang chuanchang force-pushed the replace_errorf_with_warnf branch from f5aab55 to 94f99ea Compare December 28, 2018 07:05
@allencloud
Copy link
Collaborator

LGTM

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Dec 28, 2018
@allencloud allencloud merged commit 523e40a into AliyunContainerService:master Dec 28, 2018
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 LGTM one maintainer or community participant agrees to merge the pull reuqest. size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants