File tree 2 files changed +9
-8
lines changed
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 {
268
268
if err := disc .process .Kill (); err != nil {
269
269
return err
270
270
}
271
+ if err := disc .process .Wait (); err != nil {
272
+ return err
273
+ }
271
274
disc .statusMutex .Lock ()
272
275
defer disc .statusMutex .Unlock ()
276
+ if disc .eventChan != nil {
277
+ close (disc .eventChan )
278
+ disc .eventChan = nil
279
+ }
273
280
disc .state = Dead
274
281
logrus .Infof ("killed discovery %s process" , disc .id )
275
282
return nil
@@ -371,13 +378,7 @@ func (disc *PluggableDiscovery) Quit() error {
371
378
} else if msg .Message != "OK" || msg .Error {
372
379
return errors .Errorf (tr ("command failed: %s" ), msg .Message )
373
380
}
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 ()
381
382
return nil
382
383
}
383
384
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ func (dm *DiscoveryManager) RunAll() []error {
120
120
func (dm * DiscoveryManager ) StartAll () []error {
121
121
return dm .parallelize (func (d * discovery.PluggableDiscovery ) error {
122
122
state := d .State ()
123
- if state != discovery .Idling || state == discovery . Running {
123
+ if state != discovery .Idling {
124
124
// Already started
125
125
return nil
126
126
}
You can’t perform that action at this time.
0 commit comments