Skip to content

Commit fa711f9

Browse files
author
dev
committed
fix panic when networkTraffic is nil
Signed-off-by: dev <dev@localhost>
1 parent 6bfeff8 commit fa711f9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pkg/util/execdetails/tiflash_stats.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,9 @@ func (networkTraffic *TiFlashNetworkTrafficSummary) mergeExecSummary(summary *ti
718718
// GetInterZoneTrafficBytes returns the inter zone network traffic bytes involved
719719
// between tiflash instances.
720720
func (networkTraffic *TiFlashNetworkTrafficSummary) GetInterZoneTrafficBytes() uint64 {
721+
if networkTraffic == nil {
722+
return 0
723+
}
721724
// NOTE: we only count the inter zone sent bytes here because tiflash count the traffic bytes
722725
// of all sub request. For each sub request, both side with count the send and recv traffic.
723726
// So here, we only use the send bytes as the overall traffic to avoid count the traffic twice.

0 commit comments

Comments
 (0)