S3 Tables: fix gRPC stream loop handling for list operations

- Correctly handle io.EOF to terminate loops gracefully.
- Propagate other errors to prevent silent failures.
- Ensure all list results are processed effectively.
This commit is contained in:
Chris Lu
2026-01-28 12:09:04 -08:00
parent dc4c62e742
commit f13e250fc3
2 changed files with 18 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"strings"
"time"
@@ -338,7 +339,10 @@ func (h *S3TablesHandler) listTablesInNamespaceWithClient(ctx context.Context, c
for {
entry, respErr := resp.Recv()
if respErr != nil {
break
if respErr == io.EOF {
break
}
return respErr
}
if entry.Entry == nil {
continue
@@ -415,7 +419,10 @@ func (h *S3TablesHandler) listTablesInAllNamespaces(ctx context.Context, filerCl
for {
entry, respErr := resp.Recv()
if respErr != nil {
break
if respErr == io.EOF {
break
}
return respErr
}
if entry.Entry == nil {
continue