Skip to content

Bug: gRPC streaming Send() errors silently ignored in multiple methods #4164

@hklcf

Description

@hklcf

Description

Multiple gRPC server streaming methods in daemon/started_service.go silently ignore errors returned by server.Send():

Methods affected:

  1. StartNetworkQualityTest (line 1188):

    OnProgress: func(p networkquality.Progress) {
        _ = server.Send(...)
    },
    
  2. StartSTUNTest (line 1248):

    OnProgress: func(p stun.Progress) {
        _ = server.Send(...)
    },
    
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions