Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions launchpad/pkg/flagd.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,20 @@ func stopFlagDWithoutLock() error {
if err := flagdCmd.Process.Kill(); err != nil {
return fmt.Errorf("failed to stop flagd: %v", err)
}

// Wait for the process to fully terminate with a timeout
done := make(chan error, 1)
go func() {
done <- flagdCmd.Wait()
}()

select {
case <-done:
// Process fully terminated
case <-time.After(5 * time.Second):
fmt.Println("Warning: timeout waiting for flagd process to terminate")
}

flagdCmd = nil
fmt.Println("flagd stopped")
}
Expand Down