Skip to content

Commit 93f875a

Browse files
Stream errors (#173)
* catch stream error 3
1 parent fecd8a7 commit 93f875a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.8.5] - 2021-10-22
8+
### Added
9+
* Retry logging on stream INTERNAL_ERROR errors
10+
711
## [0.8.4] - 2021-10-21
12+
### Added
813
* Add `X-Accel-Buffering=no` header to service response calls for log streaming.
914

1015
## [0.8.3] - 2021-10-05

cli/internal/api/api.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,11 @@ func (c *Client) GetLogs(ctx context.Context, workflowName string) (responses.Ge
8181
func (c *Client) StreamLogs(ctx context.Context, w io.Writer, workflowName string) error {
8282
var loggingCursorByte int64
8383
// When we receive a stream error we continue and retry processing up to 5 times keeping track of the byte we were logging.
84-
for i := 0; i < 5; i++ {
84+
for i := 0; i < 10; i++ {
8585
err := c.streamLogsToWriterAtCursor(ctx, w, workflowName, &loggingCursorByte)
8686
if err != nil {
87-
if strings.Contains(err.Error(), "stream error: stream ID 1; INTERNAL_ERROR") {
87+
// if connection idle timeout occurs retry
88+
if strings.Contains(err.Error(), "stream error: stream ID 1; INTERNAL_ERROR") || strings.Contains(err.Error(), "stream error: stream ID 3; INTERNAL_ERROR") {
8889
time.Sleep(time.Second * 10)
8990
continue
9091
}

0 commit comments

Comments
 (0)