Skip to content

Commit

Permalink
fix: transformation does not retry indefinitely when control plane is…
Browse files Browse the repository at this point in the history
… down (#3581)
  • Loading branch information
atzoum committed Jul 5, 2023
1 parent 5c442c0 commit 1c6fc24
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion processor/transformer/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ func (trans *HandleT) doPost(ctx context.Context, rawJSON []byte, url string, ta
return reqErr
}
defer func() { httputil.CloseResponse(resp) }()
if !isJobTerminated(resp.StatusCode) {
if !isJobTerminated(resp.StatusCode) && resp.StatusCode != StatusCPDown {
return fmt.Errorf("transformer returned status code: %v", resp.StatusCode)
}
respData, reqErr = io.ReadAll(resp.Body)
Expand Down
4 changes: 4 additions & 0 deletions processor/transformer/transformer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ func Test_Transformer(t *testing.T) {
}

func Test_EndlessLoopIf809(t *testing.T) {
config.Reset()
defer config.Reset()
logger.Reset()
config.Set("Processor.maxRetry", 1)
transformer.Init()

ft := &endlessLoopTransformer{
Expand Down

0 comments on commit 1c6fc24

Please sign in to comment.