Fix mysql_task_control to put task subprocess in a new process group.
- Otherwise it cannot kill all of the task's processes.
- Previous test failed to capture this because they were not run by real Mesos slaves.
diff --git a/mysos/executor/mysql_task_control.py b/mysos/executor/mysql_task_control.py
index d5ca96f..40504c9 100644
--- a/mysos/executor/mysql_task_control.py
+++ b/mysos/executor/mysql_task_control.py
@@ -150,7 +150,7 @@
conf_file=self._conf_file,
buffer_pool_size=self._buffer_pool_size))
log.info("Executing command: %s" % command)
- self._process = subprocess.Popen(command, shell=True, env=env)
+ self._process = subprocess.Popen(command, shell=True, env=env, preexec_fn=os.setpgrp)
# There is a delay before mysqld becomes available to accept requests. Wait for it.
command = "%(cmd)s %(pid_file)s %(port)s %(timeout)s" % dict(