Unmount task directories when alloc is terminal

This PR unmounts directories from tasks when the alloc is terminal
rather than when it is garbage collected.

/cc @angrycub
This commit is contained in:
Alex Dadgar
2017-08-10 13:28:17 -07:00
parent 1f3966e65e
commit 5ad955ef07

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():