From 8a561b15214148e5fba9a7bbb7ebfb36539a1c09 Mon Sep 17 00:00:00 2001 From: Alexey Shalaev <75322386+AlexeyShalaev@users.noreply.github.com> Date: Sun, 6 Sep 2026 23:06:56 +0300 Subject: [PATCH] fix: fail startup on an unreachable Redis, and count translated errors as errors The work landed in #22. Its squash subject lost the Conventional Commit prefix -- my mistake on the merge, not the author's -- so release-please skipped the merge and these fixes would never have reached a release. This commit carries the record. It changes no code: #22 is already on master. * retry_async_connection could not fail startup. It raised only when connect_func raised, while the health check returned False instead of raising, so the loop spun three times with no backoff and handed back a client that could not reach Redis. A falsy result is a retried failure now and the last attempt raises. Reproduced against a dead port. * AsyncRedisProvider.get_redis was unreachable: it and get_redis_with_health_check provided the same dishka key and the second won. The choice moved to a constructor flag and both methods are reachable. * Provider order was load-bearing and silent: the Redis provider supplied a None metrics collector, so registered after a metrics provider it overrode it and you got a plain client with no error. A flag turns the default off. * The async instrumented client read pool._all_connections, which redis-py 8 does not have, so the pool-size gauge was always zero. It sums the two attributes the sync client already used. * In all four clients the RuntimeError branch preceded the one that sets an error status, so a uvloop transport error translated to ConnectionError was counted as a success and never recorded. * The three guide pages and the docs home documented a settings API that does not exist -- every snippet raised a validation error -- along with OpenTelemetry support, a wrong redis floor, a wrong Python floor and an extra that is not declared. All corrected against the code.