Hi Chengwei, If you're launching tasks with Docker Containerizer, then we support a flag you can set on the slave (docker_stop_timeout) then basically does what you described.
At first when you kill a docker task, we're using the docker stop command with that timeout value, which basically the docker daemon sends a SIGTERM and escaltes to SIGKILL after the timeout. Tim On Wed, Apr 29, 2015 at 11:33 PM, Adam Bordelon <[email protected]> wrote: > Chengwei, see the discussion of configurable SIGTERM/KILL escalation on > https://issues.apache.org/jira/browse/MESOS-1571 > > On Wed, Apr 29, 2015 at 8:55 PM, Chengwei Yang <[email protected] > > wrote: > >> Hi List, >> >> Is there a way to configure how mesos to kill task? >> >> The background is we have a type of task, which running with mesos native >> docker >> support. The task is a kind of message consumer which will take task from >> message queue and take care of it. However, a task may be very large, >> costs >> hours to finish, so we'd like to kill the container like this: send an >> signal(TERM maybe) to it and wait for a configurable timeout to kill it >> with >> KILL. So our task consumer can handle TERM and will exit once it finished >> current task. >> >> Is there a good way to do that or any other tips? >> >> Thank you all in advance. >> >> >> -- >> Thanks, >> Chengwei >> > >

