Skip to content

Commit 7406f06

Browse files
committed
fix: handle io.EOF in Start and Reset gRPC streams
Start() and Reset() client methods treated io.EOF from stream.Recv() as an error, unlike Build(), SnapshotSave(), and other streaming methods which handle it as clean stream termination. This caused intermittent stream: EOF errors on reset and start.
1 parent 6b8bc89 commit 7406f06

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

cli/internal/client/grpc_client.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ func (c *Client) Start(dir string, statusCallback func(status, msg string)) erro
164164

165165
for {
166166
resp, err := stream.Recv()
167+
if err == io.EOF {
168+
return nil
169+
}
167170
if err != nil {
168171
return fmt.Errorf("stream: %w", err)
169172
}
@@ -281,6 +284,9 @@ func (c *Client) Reset(dir string) error {
281284

282285
for {
283286
resp, err := stream.Recv()
287+
if err == io.EOF {
288+
return nil
289+
}
284290
if err != nil {
285291
return fmt.Errorf("stream: %w", err)
286292
}

0 commit comments

Comments
 (0)