Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Stopping a Disabled task doesn't make sense. And it doesn't change the state. #1044

Closed
lynxbat opened this issue Jun 30, 2016 · 2 comments
Closed

Comments

@lynxbat
Copy link
Contributor

lynxbat commented Jun 30, 2016

❯ build/bin/snapctl task list                                                                                                            ⏎ ✭
ID                   NAME                        STATE       HIT     MISS    FAIL    CREATED         LAST FAILURE
0c9ad69d-f8a2-409c-b162-de6f3e3bd4d5     Task-0c9ad69d-f8a2-409c-b162-de6f3e3bd4d5   Disabled    10      0   10      2:16PM 6-30-2016    Publish call error: Post http://127.0.0.1:8086/write
❯ build/bin/snapctl task stop 0c9ad69d-f8a2-409c-b162-de6f3e3bd4d5                                                                         ✭
Task stopped:
ID: 0c9ad69d-f8a2-409c-b162-de6f3e3bd4d5
❯ build/bin/snapctl task list                                                                                                              ✭
ID                   NAME                        STATE       HIT     MISS    FAIL    CREATED         LAST FAILURE
0c9ad69d-f8a2-409c-b162-de6f3e3bd4d5     Task-0c9ad69d-f8a2-409c-b162-de6f3e3bd4d5   Disabled    10      0   10      2:16PM 6-30-2016    Publish call error: Post http://127.0.0.1:8086/write
@geauxvirtual
Copy link
Contributor

Looking at the code, it seems an error should be thrown for trying to execute an action on a task in a state that does not support that action. Something like the following.

--- intelsdi-x/snap » build/bin/snapctl task stop 79300219-ad4a-4c17-851e-3e431cf8839d
Error stopping task:
error 0: Disabled tasks cannot be stopped.

@jcooklin
Copy link
Collaborator

it seems an error should be thrown for trying to execute an action on a task in a state that does not support that action

I agree.

tjmcs pushed a commit that referenced this issue Jul 14, 2016
Fixes #1044: Returns an error when trying to stop a disabled task.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants