Merge pull request #3006 from hashicorp/b-unmount

Unmount task directories when alloc is terminal
This commit is contained in:
Alex Dadgar 2017-08-10 14:07:34 -07:00 committed by GitHub
commit bfcfe40b9d
1 changed files with 6 additions and 0 deletions

View File

@ -920,6 +920,12 @@ func (r *AllocRunner) handleDestroy() {
r.allocID, err)
}
// Unmount any mounted directories as no tasks are running and makes
// cleaning up Nomad's data directory simpler.
if err := r.allocDir.UnmountAll(); err != nil {
r.logger.Printf("[ERR] client: alloc %q unable unmount task directories: %v", r.allocID, err)
}
for {
select {
case <-r.ctx.Done():