File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -268,8 +268,15 @@ func (disc *PluggableDiscovery) killProcess() error {
268268 if err := disc .process .Kill (); err != nil {
269269 return err
270270 }
271+ if err := disc .process .Wait (); err != nil {
272+ return err
273+ }
271274 disc .statusMutex .Lock ()
272275 defer disc .statusMutex .Unlock ()
276+ if disc .eventChan != nil {
277+ close (disc .eventChan )
278+ disc .eventChan = nil
279+ }
273280 disc .state = Dead
274281 logrus .Infof ("killed discovery %s process" , disc .id )
275282 return nil
@@ -371,13 +378,7 @@ func (disc *PluggableDiscovery) Quit() error {
371378 } else if msg .Message != "OK" || msg .Error {
372379 return errors .Errorf (tr ("command failed: %s" ), msg .Message )
373380 }
374- disc .statusMutex .Lock ()
375- defer disc .statusMutex .Unlock ()
376- if disc .eventChan != nil {
377- close (disc .eventChan )
378- disc .eventChan = nil
379- }
380- disc .state = Dead
381+ disc .killProcess ()
381382 return nil
382383}
383384
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ func (dm *DiscoveryManager) RunAll() []error {
120120func (dm * DiscoveryManager ) StartAll () []error {
121121 return dm .parallelize (func (d * discovery.PluggableDiscovery ) error {
122122 state := d .State ()
123- if state != discovery .Idling || state == discovery . Running {
123+ if state != discovery .Idling {
124124 // Already started
125125 return nil
126126 }
You can’t perform that action at this time.
0 commit comments