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

Cannot remove an Ended Task (windowed scheduler) #1520

Closed
IzabellaRaulin opened this issue Feb 15, 2017 · 2 comments · Fixed by #1529
Closed

Cannot remove an Ended Task (windowed scheduler) #1520

IzabellaRaulin opened this issue Feb 15, 2017 · 2 comments · Fixed by #1529

Comments

@IzabellaRaulin
Copy link
Contributor

IzabellaRaulin commented Feb 15, 2017

What happened:

An "Ended" task cannot be removed - neither directly removing nor after prior stopping

This happens for a windowed schedule for which stop_timestamp is defined. That means that after this time the task is ended - this is related to changing the status from "Running" to "Ended" in line pkg/schedule/windowed_schedule.go#L101.

Steps to reproduce it

  1. Run an exemplary task manifest with window schedule, for example:

  "version": 1,
  "schedule": {
    "type": "windowed",
    "interval": "3s",
    "start_timestamp": "2017-02-15T13:20:56+01:00",
    "stop_timestamp": "2017-02-15T13:48:35+01:00"
  },
  "workflow": {
   [...]
}
  1. After a time stop_timestamp the state of task should be "Ended"
$ snaptel task list
ID                                       NAME                                            STATE           HIT     MISS    FAIL    CREATED                 LAST FAILURE
5db259f7-3403-421d-896a-78aa15031c80     Task-5db259f7-3403-421d-896a-78aa15031c80       Ended           38      0       0       1:46PM 2-15-2017

  1. Try to remove the task:
$ snaptel task remove 5db259f7-3403-421d-896a-78aa15031c80

Error stopping task:
Task must be stopped
  1. So, let's stop the task at first and then try to remove it once again:
$ snaptel task stop 5db259f7-3403-421d-896a-78aa15031c80
Task stopped:
ID: 5db259f7-3403-421d-896a-78aa15031c80

Notice that even stop command looks like be executed successfully, the state of task does NOT change to Stopped (it is still Ended)

snaptel task list
ID                                       NAME                                            STATE           HIT     MISS    FAIL    CREATED                 LAST FAILURE
5db259f7-3403-421d-896a-78aa15031c80     Task-5db259f7-3403-421d-896a-78aa15031c80       Ended           38      0       0       1:46PM 2-15-2017

Still, cannot remove this task even after trying to stop it a prior:

$ snaptel task remove 5db259f7-3403-421d-896a-78aa15031c80
Error stopping task:
Task must be stopped

It looks like a standstill.

@andrzej-k
Copy link
Contributor

Ended state should also probably be described here: https://github.com/intelsdi-x/snap/blob/master/docs/TASKS.md#task-states

@IzabellaRaulin
Copy link
Contributor Author

What can be added, ideally an Ended Task should be something that can be removed without having to stop, so it would be similar what has been done for Disabled Task in #1043.

IzabellaRaulin added a commit to IzabellaRaulin/snap that referenced this issue Feb 16, 2017
IzabellaRaulin added a commit to IzabellaRaulin/snap that referenced this issue Feb 17, 2017
IzabellaRaulin added a commit to IzabellaRaulin/snap that referenced this issue Feb 17, 2017
IzabellaRaulin added a commit to IzabellaRaulin/snap that referenced this issue Feb 17, 2017
IzabellaRaulin added a commit to IzabellaRaulin/snap that referenced this issue Feb 17, 2017
IzabellaRaulin added a commit to IzabellaRaulin/snap that referenced this issue Feb 17, 2017
IzabellaRaulin added a commit to IzabellaRaulin/snap that referenced this issue Feb 27, 2017
IRCody pushed a commit to IRCody/snap that referenced this issue Mar 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants