Currently we log on every single one of 10 retries deep in the upnp stack. However we also return the failure as an error, which is bubbled up a while until it's logged at debug level. Switch that around, such that the repeat logging happens at debug level but the top-level happens at info. There's some chance that this will newly log errors from nat-pmp that were previously hidden in debug level - I hope those are useful and not too numerous. Also potentially this can even close #9324, my (very limited) understanding of the reports/discussion there is that there's likely no problem with syncthing beyond the excessive logging, it's some weird router behaviour.
This commit is contained in:
@@ -206,7 +206,7 @@ func (s *IGDService) AddPortMapping(ctx context.Context, protocol nat.Protocol,
|
||||
}
|
||||
|
||||
err = fmt.Errorf("UPnP Error: %s (%d)", envelope.ErrorDescription, envelope.ErrorCode)
|
||||
l.Infof("Couldn't add port mapping for %s (external port %d -> internal port %d/%s): %s", s.LocalIPv4, externalPort, internalPort, protocol, err)
|
||||
l.Debugf("Couldn't add port mapping for %s (external port %d -> internal port %d/%s): %s", s.LocalIPv4, externalPort, internalPort, protocol, err)
|
||||
}
|
||||
|
||||
return externalPort, err
|
||||
|
||||
Reference in New Issue
Block a user