mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-12-04 19:08:31 +00:00
A lookup that starts while the old network is going away (for example Wi-Fi dropping on Android) can be sent to servers that will never answer. It runs on its own DefaultDNSTimeout inside the singleflight group, and every later request for the same name joins it, even after the platform has signalled the network change (Clash Meta for Android calls ClearCache and ResetConnection on every DNS change). So all requests for that name fail together when the stale lookup times out. Reset the singleflight group both before and after resetting the clients. Before, so requests made while a client reset is blocked (DoH's ResetConnection waits for clientMu) start a fresh lookup instead of joining one stuck on the old network. After, so requests made once ResetConnection returns do not join a lookup that started during the reset on a connection from before the change.