Groww Engineering Team solved persistent connection timeout issues in their Android app's NATS implementation by implementing the Happy Eyeballs (Fast Fallback) algorithm. The root cause was IPv6 routing failures due to hardware misconfigurations, where NATS would attempt to connect to the first resolved IP address and fail persistently. By modifying the socket connection logic to make staggered connection attempts to all available IP addresses (both IPv4 and IPv6) and using the first successful connection, they reduced error rates by 30% and improved connection latency by 30%. The solution was contributed back to the NATS open source repository.
Sort: