From 5dbc0bf3823046bf1335caa8f71456cace7957b9 Mon Sep 17 00:00:00 2001 From: Sean Chittenden Date: Sat, 9 Jul 2016 23:25:33 -0700 Subject: [PATCH] Rename resourceContainer.cleanup() to executorCleanup() Not to be confused with the imminent ClientCleanup(). --- client/driver/executor/executor.go | 2 +- client/driver/executor/resource_container_default.go | 2 +- client/driver/executor/resource_container_linux.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/driver/executor/executor.go b/client/driver/executor/executor.go index aca39649a..212d0f575 100644 --- a/client/driver/executor/executor.go +++ b/client/driver/executor/executor.go @@ -454,7 +454,7 @@ func (e *UniversalExecutor) Exit() error { } if e.command.ResourceLimits { - if err := e.resCon.cleanup(); err != nil { + if err := e.resCon.executorCleanup(); err != nil { merr.Errors = append(merr.Errors, err) } } diff --git a/client/driver/executor/resource_container_default.go b/client/driver/executor/resource_container_default.go index 4f5ff8ae7..4de17ab85 100644 --- a/client/driver/executor/resource_container_default.go +++ b/client/driver/executor/resource_container_default.go @@ -9,7 +9,7 @@ import ( type resourceContainer struct { } -func (rc *resourceContainer) cleanup() error { +func (rc *resourceContainer) executorCleanup() error { return nil } diff --git a/client/driver/executor/resource_container_linux.go b/client/driver/executor/resource_container_linux.go index 26dded435..4f2d79059 100644 --- a/client/driver/executor/resource_container_linux.go +++ b/client/driver/executor/resource_container_linux.go @@ -14,8 +14,8 @@ type resourceContainer struct { cgLock sync.Mutex } -// cleanup removes this host's Cgroup -func (rc *resourceContainer) cleanup() error { +// cleanup removes this host's Cgroup from within an Executor's context +func (rc *resourceContainer) executorCleanup() error { rc.cgLock.Lock() defer rc.cgLock.Unlock() if err := DestroyCgroup(rc.groups, rc.cgPaths, os.Getpid()); err != nil {