mirror of
https://github.com/netbirdio/netbird.git
synced 2026-07-16 19:49:56 +00:00
Log skipped relay fallback and bail sequential dial on cancelled context
This commit is contained in:
@@ -681,6 +681,9 @@ func (c *Client) onDatagramTooLarge(conn net.Conn, cause error) {
|
||||
// Without the shared tracker a reconnect would just race QUIC again and
|
||||
// re-fail, so leave the connection up rather than loop.
|
||||
if c.transportFallback == nil {
|
||||
if c.datagramFallbackTriggered.CompareAndSwap(false, true) {
|
||||
c.log.Debugf("%s, but no transport fallback configured, leaving connection up", cause)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -91,6 +91,9 @@ func (r *RaceDial) Dial(ctx context.Context) (net.Conn, error) {
|
||||
// falling back to the next on failure.
|
||||
func (r *RaceDial) dialSequential(ctx context.Context) (net.Conn, error) {
|
||||
for _, dfn := range r.dialerFns {
|
||||
if err := ctx.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
attemptCtx, cancel := context.WithTimeout(ctx, r.connectionTimeout)
|
||||
r.log.Infof("dialing Relay server via %s", dfn.Protocol())
|
||||
conn, err := dfn.Dial(attemptCtx, r.serverURL, r.serverName)
|
||||
|
||||
Reference in New Issue
Block a user