~serge-hallyn/ubuntu/utopic/upstart/cgroup-race1

Viewing all changes in revision 1583.

  • Committer: Serge Hallyn
  • Date: 2014-08-27 21:25:58 UTC
  • Revision ID: serge.hallyn@ubuntu.com-20140827212558-3fk017ukcbizipbt
cgroup: don't mark cgroup to autremove.

We have a race.  When main upstart job exits, all tasks are removed
from the cgroup, so autoremove kicks in.  Then post-stop tries to create
the same cgroup again.  Then it execs the tasks to be run in that
cgroup.  Between the re-create and the exec, the autoremove thread may
actually run and remove the cgroup.

So simply remove the cgroup after post-stop.  We mark it for autoremove
(in case there is a lingering task) and also try to recursively remove it.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: