Skip to content

Add configuration option for RedisConnectionPool lease timeout

Nathan Harris requested to merge add-retry-wait-config into master

Motivation:

With RedisConnectionPool a timeout is provided to prevent infinite loops of retrying connections, but right now it is hardcoded to 60 seconds.

Users of downstream projects such as Vapor are noticing a "regression" of sorts, as previously EventLoopFutures would fail immediately if a connection was not made available.

Modifications:

  • Add: connectionRetryTimeout parameter to RedisConnectionPool initializer that still defaults to 60 seconds
  • Change: RedisConnectionPool to use the new parameter if available to offset a deadline from "now"

Result:

Users can now configure the connection pool to fail immediately if connections are not available.

Merge request reports