Skip to content

Cleanup workdirs on manager load#2509

Merged
estesp merged 1 commit intocontainerd:masterfrom
crosbymichael:bundle-cleanup
Jul 30, 2018
Merged

Cleanup workdirs on manager load#2509
estesp merged 1 commit intocontainerd:masterfrom
crosbymichael:bundle-cleanup

Conversation

@crosbymichael
Copy link
Copy Markdown
Member

This cleans up persistent work dirs on TaskManager boot. These dirs can
be left behind in a machine reboot. The state in /run will not exist
but the work dir in the root does, we should cleanup work dirs when
tasks are not loaded.

This also improves error handling that would prevent the task manager
from loading when a single task fails to load or cleanup.

Signed-off-by: Michael Crosby [email protected]

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jul 30, 2018

Codecov Report

Merging #2509 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #2509   +/-   ##
======================================
  Coverage      45%     45%           
======================================
  Files          93      93           
  Lines        9583    9583           
======================================
  Hits         4313    4313           
  Misses       4575    4575           
  Partials      695     695
Flag Coverage Δ
#linux 49.04% <ø> (ø) ⬆️
#windows 41.41% <ø> (ø) ⬆️

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 e8f7c2a...23fbdba. Read the comment docs.

Comment thread runtime/v2/manager.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: error string typo: s/direction/directory/

This cleans up persistent work dirs on TaskManager boot.  These dirs can
be left behind in a machine reboot.  The state in /run will not exist
but the work dir in the root does, we should cleanup work dirs when
tasks are not loaded.

This also improves error handling that would prevent the task manager
from loading when a single task fails to load or cleanup.

Signed-off-by: Michael Crosby <[email protected]>
@crosbymichael
Copy link
Copy Markdown
Member Author

@estesp updated

Comment thread runtime/v2/manager.go
if _, err := binaryCall.Delete(ctx); err != nil {
return errors.Wrapf(err, "remove disk state %s", id)
log.G(ctx).WithError(err).Errorf("binary call to delete for %s", id)
continue
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

redundant continue

@dmcgowan
Copy link
Copy Markdown
Member

LGTM

@dmcgowan dmcgowan added this to the 1.2 milestone Jul 30, 2018
Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

@estesp estesp merged commit 6647e75 into containerd:master Jul 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants