Skip to content

Commit 71d1d0d

Browse files
committed
fix connection leak when start timeout
1 parent 4793c5e commit 71d1d0d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

client/transport/sse.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ func (c *SSE) Start(ctx context.Context) error {
114114
case <-ctx.Done():
115115
return fmt.Errorf("context cancelled while waiting for endpoint")
116116
case <-time.After(30 * time.Second): // Add a timeout
117+
cancel()
117118
return fmt.Errorf("timeout waiting for endpoint")
118119
}
119120

0 commit comments

Comments
 (0)