Skip to content

Commit

Permalink
fix: fixing timeouts (#4971)
Browse files Browse the repository at this point in the history
* fix: fixing timeouts

* fix: podStartTimeout increased
  • Loading branch information
exu authored Feb 6, 2024
1 parent 006f787 commit 1bc0381
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions pkg/logs/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import (
)

const (
buffer = 100
buffer = 100
requestDeadline = time.Minute * 5
)

// NewGrpcClient imlpements getter interface for log stream for given ID
Expand All @@ -39,7 +40,7 @@ func (c GrpcClient) Get(ctx context.Context, id string) (chan events.LogResponse
log.Debugw("getting logs", "address", c.address)
go func() {
// Contact the server and print out its response.
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
ctx, cancel := context.WithTimeout(context.Background(), requestDeadline)
defer cancel()
defer close(ch)

Expand Down Expand Up @@ -67,7 +68,7 @@ func (c GrpcClient) Get(ctx context.Context, id string) (chan events.LogResponse
log.Debugw("received log chunk from client", "log", l, "error", err)
if err == io.EOF {
log.Debugw("client stream finished", "error", err)
break
return
} else if err != nil {
log.Errorw("error receiving log response", "error", err)
ch <- events.LogResponse{Error: err}
Expand Down
2 changes: 1 addition & 1 deletion pkg/logs/sidecar/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var (

const (
pollInterval = time.Second
podStartTimeout = time.Second * 60
podStartTimeout = 30 * time.Minute
logsBuffer = 1000
)

Expand Down

0 comments on commit 1bc0381

Please sign in to comment.