Re: Default executor grace period

2017-04-25 Thread Alex Rukletsov
Commented on the ticket.

On Tue, Jan 17, 2017 at 12:27 PM, Tomek Janiszewski 
wrote:

> Created issue for this: https://issues.apache.org/jira/browse/MESOS-6933
>
> pon., 16 sty 2017 o 17:13 użytkownik Tomek Janiszewski 
> napisał:
>
>> I looks like it's supported because executor prints grace period[1]. On
>> the other hand executor launches sh that launch command and shell executes
>> faster then command after receiving SIGTERM. Causing process to be attached
>> to init and leaked. In my opinion default executor should not sent SIGTERM
>> to sh but only to its children. This will allow proper escalation to
>> SIGKILL because sh will leave as long its children are alive.
>>
>> 1: https://github.com/apache/mesos/blob/c4667d6f1b49d30089e6cb5874b673
>> 7a9bd3f044/src/launcher/executor.cpp#L479-L480
>>
>> pon., 16 sty 2017 o 16:35 użytkownik haosdent 
>> napisał:
>>
>> It looks like default-executor have not yet handle
>> `--executor_shutdown_grace_period`。
>>
>> On Mon, Jan 16, 2017 at 7:41 PM, Tomek Janiszewski 
>> wrote:
>>
>> Hi
>>
>> I tried to use grace period with default Mesos executor. I assumed it
>> works as follow:
>>
>>1. Start command: sh -c "command ..."
>>2. Sent SIGSTOP to process tree: sh, command
>>3. Sent SIGTERM to process tree: sh, command
>>4. Wait for processes to finish or grace period to elapse
>>5. sh finish while command could be still running and attached to init
>>6. Sent SIGKILL to process tree: command
>>
>> I notice that SIGKILL is not sent and executor finished when sh returns.
>> When Mesos is running with POSIX contenerizer this leads command to live
>> forever (if it ignores SIGTERM). When contenerizer is used command is
>> killed when it's container is destroyed.
>>
>> Is this desired behavior? How to use grace period with default executor?
>>
>> Thanks
>> Tomek
>>
>>
>>
>>
>> --
>> Best Regards,
>> Haosdent Huang
>>
>>


Re: Default executor grace period

2017-01-17 Thread Tomek Janiszewski
Created issue for this: https://issues.apache.org/jira/browse/MESOS-6933

pon., 16 sty 2017 o 17:13 użytkownik Tomek Janiszewski 
napisał:

> I looks like it's supported because executor prints grace period[1]. On
> the other hand executor launches sh that launch command and shell executes
> faster then command after receiving SIGTERM. Causing process to be attached
> to init and leaked. In my opinion default executor should not sent SIGTERM
> to sh but only to its children. This will allow proper escalation to
> SIGKILL because sh will leave as long its children are alive.
>
> 1:
> https://github.com/apache/mesos/blob/c4667d6f1b49d30089e6cb5874b6737a9bd3f044/src/launcher/executor.cpp#L479-L480
>
> pon., 16 sty 2017 o 16:35 użytkownik haosdent 
> napisał:
>
> It looks like default-executor have not yet handle
> `--executor_shutdown_grace_period`。
>
> On Mon, Jan 16, 2017 at 7:41 PM, Tomek Janiszewski 
> wrote:
>
> Hi
>
> I tried to use grace period with default Mesos executor. I assumed it
> works as follow:
>
>1. Start command: sh -c "command ..."
>2. Sent SIGSTOP to process tree: sh, command
>3. Sent SIGTERM to process tree: sh, command
>4. Wait for processes to finish or grace period to elapse
>5. sh finish while command could be still running and attached to init
>6. Sent SIGKILL to process tree: command
>
> I notice that SIGKILL is not sent and executor finished when sh returns.
> When Mesos is running with POSIX contenerizer this leads command to live
> forever (if it ignores SIGTERM). When contenerizer is used command is
> killed when it's container is destroyed.
>
> Is this desired behavior? How to use grace period with default executor?
>
> Thanks
> Tomek
>
>
>
>
> --
> Best Regards,
> Haosdent Huang
>
>


Re: Default executor grace period

2017-01-16 Thread Tomek Janiszewski
I looks like it's supported because executor prints grace period[1]. On the
other hand executor launches sh that launch command and shell executes
faster then command after receiving SIGTERM. Causing process to be attached
to init and leaked. In my opinion default executor should not sent SIGTERM
to sh but only to its children. This will allow proper escalation to
SIGKILL because sh will leave as long its children are alive.

1:
https://github.com/apache/mesos/blob/c4667d6f1b49d30089e6cb5874b6737a9bd3f044/src/launcher/executor.cpp#L479-L480

pon., 16 sty 2017 o 16:35 użytkownik haosdent  napisał:

> It looks like default-executor have not yet handle
> `--executor_shutdown_grace_period`。
>
> On Mon, Jan 16, 2017 at 7:41 PM, Tomek Janiszewski 
> wrote:
>
> Hi
>
> I tried to use grace period with default Mesos executor. I assumed it
> works as follow:
>
>1. Start command: sh -c "command ..."
>2. Sent SIGSTOP to process tree: sh, command
>3. Sent SIGTERM to process tree: sh, command
>4. Wait for processes to finish or grace period to elapse
>5. sh finish while command could be still running and attached to init
>6. Sent SIGKILL to process tree: command
>
> I notice that SIGKILL is not sent and executor finished when sh returns.
> When Mesos is running with POSIX contenerizer this leads command to live
> forever (if it ignores SIGTERM). When contenerizer is used command is
> killed when it's container is destroyed.
>
> Is this desired behavior? How to use grace period with default executor?
>
> Thanks
> Tomek
>
>
>
>
> --
> Best Regards,
> Haosdent Huang
>


Re: Default executor grace period

2017-01-16 Thread haosdent
It looks like default-executor have not yet handle
`--executor_shutdown_grace_period`。

On Mon, Jan 16, 2017 at 7:41 PM, Tomek Janiszewski 
wrote:

> Hi
>
> I tried to use grace period with default Mesos executor. I assumed it
> works as follow:
>
>1. Start command: sh -c "command ..."
>2. Sent SIGSTOP to process tree: sh, command
>3. Sent SIGTERM to process tree: sh, command
>4. Wait for processes to finish or grace period to elapse
>5. sh finish while command could be still running and attached to init
>6. Sent SIGKILL to process tree: command
>
> I notice that SIGKILL is not sent and executor finished when sh returns.
> When Mesos is running with POSIX contenerizer this leads command to live
> forever (if it ignores SIGTERM). When contenerizer is used command is
> killed when it's container is destroyed.
>
> Is this desired behavior? How to use grace period with default executor?
>
> Thanks
> Tomek
>



-- 
Best Regards,
Haosdent Huang


Default executor grace period

2017-01-16 Thread Tomek Janiszewski
Hi

I tried to use grace period with default Mesos executor. I assumed it works
as follow:

   1. Start command: sh -c "command ..."
   2. Sent SIGSTOP to process tree: sh, command
   3. Sent SIGTERM to process tree: sh, command
   4. Wait for processes to finish or grace period to elapse
   5. sh finish while command could be still running and attached to init
   6. Sent SIGKILL to process tree: command

I notice that SIGKILL is not sent and executor finished when sh returns.
When Mesos is running with POSIX contenerizer this leads command to live
forever (if it ignores SIGTERM). When contenerizer is used command is
killed when it's container is destroyed.

Is this desired behavior? How to use grace period with default executor?

Thanks
Tomek