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

Stopping a task with plugin initiated workflow should not panic #1588

Merged

Conversation

IzabellaRaulin
Copy link
Contributor

@IzabellaRaulin IzabellaRaulin commented Apr 4, 2017

Fixes #1589

Before:

Stopping a task with streaming schedule caused a panic:
image

After

Stopping the task behaves as expected:

  • there is no panic, no errors in snapteld logs
  • the task is in state Stopped after that

Summary of changes:

Testing done:

  • manual tests

@intelsdi-x/snap-maintainers

@candysmurf
Copy link
Contributor

@IzabellaRaulin, do you mind open an issue with the steps to reproduce this issue?

@IzabellaRaulin
Copy link
Contributor Author

@candysmurf, I created #1589 - there you can find step by step how to reproduce that issue

@@ -236,7 +236,7 @@ func (a *availablePlugin) Stop(r string) error {
return a.client.Kill(r)
}

// Kill assumes aplugin is not able to here a Kill RPC call
// Kill assumes a plugin is not able to here a Kill RPC call
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/here/hear/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch - I changed it to "hear"

t.state = core.TaskStopped
break
t.Unlock()
done = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After removing g.killed() in control/plugin/client/grpc.go, where are we closing the channel to be able to receive "closing of killChan" here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works exactly in the same way as for regular spin() - so it happens here: https://github.com/intelsdi-x/snap/blob/master/scheduler/task.go#L360

Copy link
Collaborator

@jcooklin jcooklin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@candysmurf
Copy link
Contributor

LGTM

@candysmurf candysmurf merged commit 74b20af into intelsdi-x:master Apr 6, 2017
@IzabellaRaulin
Copy link
Contributor Author

Thank You

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants