New features
client_namenames Redis connections. Sets the name shown inCLIENT LISTfor standalone, cluster, and failover clients, including connections used by consumers of the shared client. Supports Caddy placeholders and defaults to unnamed. Names with spaces, newlines or characters outside printable ASCII are rejected when the configuration loads, as Redis would reject them. Different names use separate pooled clients.- Redis clients are shared across storage instances and configuration reloads. Clients with matching connection settings use a reference-counted pool. The new
client_shutdown_grace_periodsetting (ClientShutdownGracePeriodin Go) keeps clients available for background operations after storage cleanup and defaults to10s. Set it to0sto add no delay for that instance; negative values are rejected. - External consumers can retain clients with
AcquireClient(). The method returns the existing client and an idempotent release function, allowing consumers to keep using the client beyond storage cleanup. Acquisition from unprovisioned or cleaned-up storage returnsErrClientUnavailable.GetClient()remains available without retaining a reference; callers must not close shared clients directly. skip_connection_checkdefers the initial Redis connection check. The module sends aPINGduring provisioning, socaddy validateand a start or reload fail while the server is unreachable. Withskip_connection_check true(SkipConnectionCheckin Go) the configuration is still validated but the probe is skipped, and connection errors surface on first use. A pooled client created without the check is probed before it is shared with an instance that requires it. Defaults tofalse.
Improvements
- Shutdown honors every storage instance's grace period and outstanding consumer references. Repeated cleanup or release calls do not release additional references, and stale timer callbacks cannot close a client after it has been reacquired and given a new shutdown deadline.
- TLS trust-file changes are respected when selecting pooled clients. Trust files are read and validated during provisioning, and their contents participate in the pool identity so replacing a file at the same path takes effect on reload.
Bug fixes
- Clients are closed when initial connection validation fails. Failed
PINGor shard validation no longer leaves newly created clients open.
API changes
Cleanup()now returns immediate client-close errors instead of always returningnil. The release function returned byAcquireClient()also returns immediate close errors. Errors from delayed shutdown are logged. Repeated calls return the same result without attempting another release.