mirror of
https://github.com/netbirdio/netbird.git
synced 2026-07-19 23:11:29 +02:00
OpenConn held relayClientMu for the whole call, including the network-bound FallbackOpener.Run, which blocked onServerDisconnected/storeClient from taking the write lock and delayed reconnect by up to the race timeout. Snapshot the home relay client under the read lock, release it, and run the foreign check and the race on the snapshot. isForeignServer now takes the client so it uses the snapshot instead of re-reading the field after the lock is dropped.