Description
Multiple gRPC server streaming methods in daemon/started_service.go silently ignore errors returned by server.Send():
Methods affected:
-
StartNetworkQualityTest (line 1188):
OnProgress: func(p networkquality.Progress) {
_ = server.Send(...)
},
-
StartSTUNTest (line 1248):
OnProgress: func(p stun.Progress) {
_ = server.Send(...)
},
-
StartTailscalePing (line 1462):
return provider.StartTailscalePing(server.Context(), request.PeerIP, func(...) {
_ = server.Send(...)
})
Impact
- If the client disconnects or the stream breaks,
Send() fails. The server continues processing and calling Send(), wasting resources and potentially keeping goroutines alive unnecessarily.
- For long-running streaming operations (StartNetworkQualityTest, StartSTUNTest), the server continues running the test even though no client is receiving results.
- SubscribeTailscaleStatus (line 1351-1356) correctly checks
sendErr and returns it - these three methods should follow the same pattern.
Location
daemon/started_service.go:1188,1248,1462
Suggested Fix
Check the error from server.Send() and abort the streaming operation on failure.
Description
Multiple gRPC server streaming methods in
daemon/started_service.gosilently ignore errors returned byserver.Send():Methods affected:
StartNetworkQualityTest (line 1188):
StartSTUNTest (line 1248):
StartTailscalePing (line 1462):
Impact
Send()fails. The server continues processing and callingSend(), wasting resources and potentially keeping goroutines alive unnecessarily.sendErrand returns it - these three methods should follow the same pattern.Location
daemon/started_service.go:1188,1248,1462Suggested Fix
Check the error from
server.Send()and abort the streaming operation on failure.