You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IPv6 Redis fallback cache URLs lose brackets and disable the cache #1227
All four valid Redis URLs initialize a RedisFlagCache. IPv6 literals must remain bracketed in the URL passed to redis.from_url.
Actual Result
The IPv4 and hostname controls print True. Both bracketed IPv6 URLs print False, with warnings:
Port could not be cast to integer value as ':1:6379', flag caching disabled
Port could not be cast to integer value as 'db8::1:6380', flag caching disabled
Client._initialize_flag_cache reconstructs the Redis authority using parsed.hostname. urlparse removes the brackets from an IPv6 hostname, so redis://[::1]:6379/0 becomes redis://::1:6379/0. redis-py then rejects the port before any connection attempt, and the initializer returns None.
Reproduced twice with the full Client initializer. As a negative control, passing the original bracketed authority to redis.from_url parses both IPv6 hosts and ports correctly. Only ping was mocked; this does not claim a live Redis-server integration test.
This is separate from #1079/#1080: TLS scheme acceptance is already fixed, but the hostname reconstruction still breaks IPv6 for both redis and rediss.
Activity
posthog commentedon Nov 11, 2026
PostHog self-driving picked up this issue. Status: Research is done.
Somebody may already be working on it, so ask before you start a fix.
Report (team access only): https://us.posthog.com/project/2/inbox/reports/01a1cadd-db40-74b1-abcc-00548f82696f?link_source=github_comment