Skip to content

Commit

Permalink
fix: router transformer client fails with error connect: cannot assig…
Browse files Browse the repository at this point in the history
…n requested address (#3898)
  • Loading branch information
atzoum committed Sep 21, 2023
1 parent 20869a1 commit 1cb5d5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions processor/transformer/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ func NewTransformer(conf *config.Config, log logger.Logger, stat stats.Stats, op
trans.cpDownGauge = stat.NewStat("processor.control_plane_down", stats.GaugeType)

trans.config.maxConcurrency = conf.GetInt("Processor.maxConcurrency", 200)
trans.config.maxHTTPConnections = conf.GetInt("Processor.maxHTTPConnections", 100)
trans.config.maxHTTPIdleConnections = conf.GetInt("Processor.maxHTTPIdleConnections", 5)
trans.config.maxHTTPConnections = conf.GetInt("Transformer.Client.maxHTTPConnections", 100)
trans.config.maxHTTPIdleConnections = conf.GetInt("Transformer.Client.maxHTTPIdleConnections", 10)
trans.config.disableKeepAlives = conf.GetBool("Transformer.Client.disableKeepAlives", true)
trans.config.timeoutDuration = conf.GetDuration("HttpClient.procTransformer.timeout", 600, time.Second)
trans.config.destTransformationURL = conf.GetString("DEST_TRANSFORM_URL", "http://localhost:9090")
Expand All @@ -220,7 +220,7 @@ func NewTransformer(conf *config.Config, log logger.Logger, stat stats.Stats, op
DisableKeepAlives: trans.config.disableKeepAlives,
MaxConnsPerHost: trans.config.maxHTTPConnections,
MaxIdleConnsPerHost: trans.config.maxHTTPIdleConnections,
IdleConnTimeout: time.Minute,
IdleConnTimeout: 30 * time.Second,
},
Timeout: trans.config.timeoutDuration,
}
Expand Down
7 changes: 6 additions & 1 deletion router/transformer/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,12 @@ func (trans *handle) setup(destinationTimeout, transformTimeout time.Duration) {
trans.logger = loggerOverride
}

trans.tr = &http.Transport{DisableKeepAlives: config.GetBool("Transformer.Client.disableKeepAlives", true)}
trans.tr = &http.Transport{
DisableKeepAlives: config.GetBool("Transformer.Client.disableKeepAlives", true),
MaxConnsPerHost: config.GetInt("Transformer.Client.maxHTTPConnections", 100),
MaxIdleConnsPerHost: config.GetInt("Transformer.Client.maxHTTPIdleConnections", 10),
IdleConnTimeout: 30 * time.Second,
}
// The timeout between server and transformer
// Basically this timeout is more for communication between transformer and server
trans.transformTimeout = transformTimeout
Expand Down

0 comments on commit 1cb5d5d

Please sign in to comment.