[ 
https://issues.apache.org/jira/browse/SLIDER-1009?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15133609#comment-15133609
 ] 

Gour Saha commented on SLIDER-1009:
-----------------------------------

test_signal_handler fails with this patch -

{color:red}
{noformat}
======================================================================
ERROR: test_signal_handler (TestMain.TestMain)
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/Users/gsaha/work/workspace/incubator-slider_8/slider-agent/target/test/mock/mock.py",
 line 1199, in patched
    return func(*args, **keywargs)
  File 
"/Users/gsaha/work/workspace/incubator-slider_8/slider-agent/target/test/agent/TestMain.py",
 line 60, in test_signal_handler
    main.signal_handler("signum", "frame")
  File 
"/Users/gsaha/work/workspace/incubator-slider_8/slider-agent/target/src/agent/main.py",
 line 63, in signal_handler
    if controller.stopCommand is not None:
AttributeError: 'Controller' object has no attribute 'stopCommand'

----------------------------------------------------------------------
{noformat}
{color}

So I had to modify the patch and add a check to _*main.py*_ as follows -
{code}
  if controller is not None and hasattr(controller, 'stopCommand'):
    controller.stopCommand = _increment_task_id(controller.stopCommand)
    controller.appGracefulStopQueued = True
    controller.actionQueue.execute_command(controller.stopCommand)
{code}

[~Jaeboo] is it possible to add a unit test for this patch?

> Slider stop command doesn’t invoke stop function inside an app package
> ----------------------------------------------------------------------
>
>                 Key: SLIDER-1009
>                 URL: https://issues.apache.org/jira/browse/SLIDER-1009
>             Project: Slider
>          Issue Type: Improvement
>          Components: agent
>    Affects Versions: Slider 0.81
>            Reporter: Jaeboo Jeong
>            Assignee: Jaeboo Jeong
>         Attachments: SLIDER-1009.patch
>
>
> As you know, slider stop does not stop the components started by slider, 
> instead it stops only SliderAM.
> In many case, this problem will be solved via YARN-3561 or HADOOP-11989.
> But if there isn’t any relation between component processes and slider agent 
> process,
> the components will remain after slider application is stopped.
> If we want to stop the remained components, we need to invoke a stop function.
> (Of course it assumes that the stop function has the abilities that can stop 
> components.)
> I patched the source code that is based on slider 0.81.1 + SLIDER-128 patch.
> When the agent receives the kill signal, the agent executes a stop command 
> like DockerManager
> and then all components will be stopped.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to