Skip to content

Commit bd6b1cc

Browse files
committed
Force probe in debug bundle cmd
1 parent 0b9e828 commit bd6b1cc

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

client/cmd/debug.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func runForDuration(cmd *cobra.Command, args []string) error {
168168

169169
client := proto.NewDaemonServiceClient(conn)
170170

171-
stat, err := client.Status(cmd.Context(), &proto.StatusRequest{})
171+
stat, err := client.Status(cmd.Context(), &proto.StatusRequest{ShouldRunProbes: true})
172172
if err != nil {
173173
return fmt.Errorf("failed to get status: %v", status.Convert(err).Message())
174174
}
@@ -303,7 +303,7 @@ func setSyncResponsePersistence(cmd *cobra.Command, args []string) error {
303303

304304
func getStatusOutput(cmd *cobra.Command, anon bool) string {
305305
var statusOutputString string
306-
statusResp, err := getStatus(cmd.Context())
306+
statusResp, err := getStatus(cmd.Context(), true)
307307
if err != nil {
308308
cmd.PrintErrf("Failed to get status: %v\n", err)
309309
} else {

client/cmd/status.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func statusFunc(cmd *cobra.Command, args []string) error {
6868

6969
ctx := internal.CtxInitState(cmd.Context())
7070

71-
resp, err := getStatus(ctx)
71+
resp, err := getStatus(ctx, false)
7272
if err != nil {
7373
return err
7474
}
@@ -121,7 +121,7 @@ func statusFunc(cmd *cobra.Command, args []string) error {
121121
return nil
122122
}
123123

124-
func getStatus(ctx context.Context) (*proto.StatusResponse, error) {
124+
func getStatus(ctx context.Context, shouldRunProbes bool) (*proto.StatusResponse, error) {
125125
conn, err := DialClientGRPCServer(ctx, daemonAddr)
126126
if err != nil {
127127
return nil, fmt.Errorf("failed to connect to daemon error: %v\n"+
@@ -130,7 +130,7 @@ func getStatus(ctx context.Context) (*proto.StatusResponse, error) {
130130
}
131131
defer conn.Close()
132132

133-
resp, err := proto.NewDaemonServiceClient(conn).Status(ctx, &proto.StatusRequest{GetFullPeerStatus: true, ShouldRunProbes: true})
133+
resp, err := proto.NewDaemonServiceClient(conn).Status(ctx, &proto.StatusRequest{GetFullPeerStatus: true, ShouldRunProbes: shouldRunProbes})
134134
if err != nil {
135135
return nil, fmt.Errorf("status failed: %v", status.Convert(err).Message())
136136
}

client/server/server.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,10 +1050,7 @@ func (s *Server) Status(
10501050
s.statusRecorder.UpdateRosenpass(s.config.RosenpassEnabled, s.config.RosenpassPermissive)
10511051

10521052
if msg.GetFullPeerStatus {
1053-
if msg.ShouldRunProbes {
1054-
s.runProbes()
1055-
}
1056-
1053+
s.runProbes(msg.ShouldRunProbes)
10571054
fullStatus := s.statusRecorder.GetFullStatus()
10581055
pbFullStatus := toProtoFullStatus(fullStatus)
10591056
pbFullStatus.Events = s.statusRecorder.GetEventHistory()
@@ -1063,7 +1060,7 @@ func (s *Server) Status(
10631060
return &statusResponse, nil
10641061
}
10651062

1066-
func (s *Server) runProbes() {
1063+
func (s *Server) runProbes(waitForProbeResult bool) {
10671064
if s.connectClient == nil {
10681065
return
10691066
}
@@ -1074,7 +1071,7 @@ func (s *Server) runProbes() {
10741071
}
10751072

10761073
if time.Since(s.lastProbe) > probeThreshold {
1077-
if engine.RunHealthProbes(true) {
1074+
if engine.RunHealthProbes(waitForProbeResult) {
10781075
s.lastProbe = time.Now()
10791076
}
10801077
}

0 commit comments

Comments
 (0)