This repository was archived by the owner on Nov 8, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ func (a *availablePlugin) Stop(r string) error {
236236 return a .client .Kill (r )
237237}
238238
239- // Kill assumes aplugin is not able to here a Kill RPC call
239+ // Kill assumes a plugin is not able to hear a Kill RPC call
240240func (a * availablePlugin ) Kill (r string ) error {
241241 log .WithFields (log.Fields {
242242 "_module" : "control-aplugin" ,
@@ -252,6 +252,7 @@ func (a *availablePlugin) Kill(r string) error {
252252 }).Debug ("deleting available plugin package" )
253253 os .RemoveAll (filepath .Dir (a .execPath ))
254254 }
255+
255256 // If it's a streaming plugin, we need to signal the scheduler that
256257 // this plugin is being killed.
257258 if c , ok := a .client .(client.PluginStreamCollectorClient ); ok {
Original file line number Diff line number Diff line change @@ -219,10 +219,8 @@ func (g *grpcClient) Killed() {
219219}
220220
221221func (g * grpcClient ) Kill (reason string ) error {
222-
223222 _ , err := g .plugin .Kill (getContext (g .timeout ), & rpc.KillArg {Reason : reason })
224223 g .conn .Close ()
225- g .Killed ()
226224 if err != nil {
227225 return err
228226 }
Original file line number Diff line number Diff line change @@ -295,8 +295,11 @@ func (t *task) stream() {
295295 }
296296 select {
297297 case <- t .killChan :
298+ t .Lock ()
298299 t .state = core .TaskStopped
299- break
300+ t .Unlock ()
301+ done = true
302+ return
300303 case mts , ok := <- metricsChan :
301304 if ! ok {
302305 metricsChan = nil
You can’t perform that action at this time.
0 commit comments