Skip to content

Commit

Permalink
chore: applying 1.9.4 hotfixes to main branch (#3454)
Browse files Browse the repository at this point in the history
  • Loading branch information
atzoum committed Jun 6, 2023
1 parent b25003d commit e0d7b6d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [1.9.4](https://github.com/rudderlabs/rudder-server/compare/v1.9.3...v1.9.4) (2023-06-06)


### Miscellaneous

* add resp body status check ([#3446](https://github.com/rudderlabs/rudder-server/issues/3446)) ([b251b21](https://github.com/rudderlabs/rudder-server/commit/b251b217787b0b2c919378a40c950b8ea719d7be))

## [1.9.3](https://github.com/rudderlabs/rudder-server/compare/v1.9.2...v1.9.3) (2023-05-31)


Expand Down
10 changes: 10 additions & 0 deletions processor/transformer/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ func Init() {
pkgLogger = logger.NewLogger().Child("processor").Child("transformer")
}

func isJobTerminated(status int) bool {
if status == http.StatusTooManyRequests {
return false
}
return status >= http.StatusOK && status < http.StatusInternalServerError
}

func loadConfig() {
config.RegisterIntConfigVariable(200, &maxConcurrency, false, 1, "Processor.maxConcurrency")
config.RegisterIntConfigVariable(100, &maxHTTPConnections, false, 1, "Processor.maxHTTPConnections")
Expand Down Expand Up @@ -390,6 +397,9 @@ func (trans *HandleT) doPost(ctx context.Context, rawJSON []byte, url string, ta
return reqErr
}
defer func() { httputil.CloseResponse(resp) }()
if !isJobTerminated(resp.StatusCode) {
return fmt.Errorf("transformer returned status code: %v", resp.StatusCode)
}
respData, reqErr = io.ReadAll(resp.Body)
return reqErr
},
Expand Down

0 comments on commit e0d7b6d

Please sign in to comment.