diff --git a/worker/cgroup.go b/worker/cgroup.go index 6e3250b..962c1c9 100644 --- a/worker/cgroup.go +++ b/worker/cgroup.go @@ -52,15 +52,15 @@ func (c *cgroupHook) preExec() error { if err := sh.Command("cgcreate", "-g", c.Cgroup()).Run(); err != nil { return err } - if cgSubsystem != "memory" { - return nil - } - if c.provider.Type() == provRsync || c.provider.Type() == provTwoStageRsync { - gname := fmt.Sprintf("%s/%s", c.baseGroup, c.provider.Name()) - return sh.Command( - "cgset", "-r", "memory.limit_in_bytes=512M", gname, - ).Run() - } + // if cgSubsystem != "memory" { + // return nil + // } + // if c.provider.Type() == provRsync || c.provider.Type() == provTwoStageRsync { + // gname := fmt.Sprintf("%s/%s", c.baseGroup, c.provider.Name()) + // return sh.Command( + // "cgset", "-r", "memory.limit_in_bytes=512M", gname, + // ).Run() + // } return nil } diff --git a/worker/cgroup_test.go b/worker/cgroup_test.go index ffefa8f..6a53441 100644 --- a/worker/cgroup_test.go +++ b/worker/cgroup_test.go @@ -4,7 +4,6 @@ import ( "io/ioutil" "os" "path/filepath" - "strconv" "strings" "testing" "time" @@ -134,11 +133,11 @@ sleep 30 provider.AddHook(cg) cg.preExec() - if cgSubsystem == "memory" { - memoLimit, err := ioutil.ReadFile(filepath.Join(cg.basePath, "memory", cg.baseGroup, provider.Name(), "memory.limit_in_bytes")) - So(err, ShouldBeNil) - So(strings.Trim(string(memoLimit), "\n"), ShouldEqual, strconv.Itoa(512*1024*1024)) - } + //if cgSubsystem == "memory" { + // memoLimit, err := ioutil.ReadFile(filepath.Join(cg.basePath, "memory", cg.baseGroup, provider.Name(), "memory.limit_in_bytes")) + // So(err, ShouldBeNil) + // So(strings.Trim(string(memoLimit), "\n"), ShouldEqual, strconv.Itoa(512*1024*1024)) + //} cg.postExec() }) }