Merge pull request #1652 from hashicorp/b-monitor-alloc-dir

Monitor the complete alloc directory, not just the shared part.
This commit is contained in:
Alex Dadgar 2016-08-25 13:10:13 -07:00 committed by GitHub
commit 499f335fea
2 changed files with 4 additions and 4 deletions

View File

@ -173,9 +173,9 @@ func TestAllocRunner_DiskExceeded_Destroy(t *testing.T) {
t.Fatalf("err: %v", err)
})
// Create a 20mb file in the shared alloc directory, which should cause the
// Create a 20mb file in the alloc directory, which should cause the
// allocation to terminate in a failed state.
name := ar.ctx.AllocDir.SharedDir + "/20mb.bin"
name := ar.ctx.AllocDir.AllocDir + "/20mb.bin"
f, err := os.Create(name)
if err != nil {
t.Fatal("unable to create file: %v", err)

View File

@ -514,11 +514,11 @@ func (d *AllocDir) StopDiskWatcher() {
}
}
// syncDiskUsage walks the shared allocation directory recursively and
// syncDiskUsage walks the allocation directory recursively and
// calculates the total consumed disk space.
func (d *AllocDir) syncDiskUsage() error {
var size int64
err := filepath.Walk(d.SharedDir,
err := filepath.Walk(d.AllocDir,
func(path string, info os.FileInfo, err error) error {
// Ignore paths that do not have a valid FileInfo object
if err == nil {