Skip to content

Commit

Permalink
chore: increase transformer request timeouts (#3701)
Browse files Browse the repository at this point in the history
  • Loading branch information
atzoum committed Aug 3, 2023
1 parent c81c66f commit 998ce44
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion processor/transformer/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func NewTransformer(conf *config.Config, log logger.Logger, stat stats.Stats, op
trans.config.maxHTTPConnections = conf.GetInt("Processor.maxHTTPConnections", 100)
trans.config.maxHTTPIdleConnections = conf.GetInt("Processor.maxHTTPIdleConnections", 5)
trans.config.disableKeepAlives = conf.GetBool("Transformer.Client.disableKeepAlives", true)
trans.config.timeoutDuration = conf.GetDuration("HttpClient.procTransformer.timeout", 30, time.Second)
trans.config.timeoutDuration = conf.GetDuration("HttpClient.procTransformer.timeout", 600, time.Second)

trans.config.destTransformationURL = conf.GetString("DEST_TRANSFORM_URL", "http://localhost:9090")
trans.config.userTransformationURL = conf.GetString("USER_TRANSFORM_URL", trans.config.destTransformationURL)
Expand Down
2 changes: 1 addition & 1 deletion router/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type Handle struct {
destType string
guaranteeUserEventOrder bool
netClientTimeout time.Duration
backendProxyTimeout time.Duration
transformerTimeout time.Duration
enableBatching bool
noOfWorkers int
barrierConcurrencyLimit int
Expand Down
4 changes: 2 additions & 2 deletions router/handle_lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (rt *Handle) Setup(

netClientTimeoutKeys := []string{"Router." + rt.destType + "." + "httpTimeout", "Router." + rt.destType + "." + "httpTimeoutInS", "Router." + "httpTimeout", "Router." + "httpTimeoutInS"}
config.RegisterDurationConfigVariable(10, &rt.netClientTimeout, false, time.Second, netClientTimeoutKeys...)
config.RegisterDurationConfigVariable(30, &rt.backendProxyTimeout, false, time.Second, "HttpClient.backendProxy.timeout")
config.RegisterDurationConfigVariable(600, &rt.transformerTimeout, false, time.Second, "HttpClient.backendProxy.timeout", "HttpClient.routerTransformer.timeout")
rt.crashRecover()
rt.responseQ = make(chan workerJobStatus, rt.reloadableConfig.jobQueryBatchSize)
if rt.netHandle == nil {
Expand Down Expand Up @@ -135,7 +135,7 @@ func (rt *Handle) Setup(
rt.throttlingErrorStat = stats.Default.NewTaggedStat("router_throttling_error", stats.CountType, statTags)
rt.throttledStat = stats.Default.NewTaggedStat("router_throttled", stats.CountType, statTags)

rt.transformer = transformer.NewTransformer(rt.netClientTimeout, rt.backendProxyTimeout)
rt.transformer = transformer.NewTransformer(rt.netClientTimeout, rt.transformerTimeout)

rt.oauth = oauth.NewOAuthErrorHandler(backendConfig)

Expand Down
4 changes: 2 additions & 2 deletions router/transformer/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ type Transformer interface {
}

// NewTransformer creates a new transformer
func NewTransformer(netClientTimeout, backendProxyTimeout time.Duration) Transformer {
func NewTransformer(destinationTimeout, transformTimeout time.Duration) Transformer {
handle := &handle{}
handle.setup(netClientTimeout, backendProxyTimeout)
handle.setup(destinationTimeout, transformTimeout)
return handle
}

Expand Down
2 changes: 1 addition & 1 deletion router/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ func (w *worker) accept(wj workerJob) {
func (w *worker) trackStuckDelivery() chan struct{} {
var d time.Duration
if w.rt.reloadableConfig.transformerProxy {
d = (w.rt.backendProxyTimeout + w.rt.netClientTimeout) * 2
d = (w.rt.transformerTimeout + w.rt.netClientTimeout) * 2
} else {
d = w.rt.netClientTimeout * 2
}
Expand Down

0 comments on commit 998ce44

Please sign in to comment.