renproject / aw

A flexible P2P networking library for upgradable distributed systems.
MIT License
38 stars 18 forks source link

Transport dial method will potentially spam dials if dial context is exceeded or cancelled #63

Closed rahulghangas closed 3 years ago

rahulghangas commented 3 years ago

Transport dial method will spam dials if dial context is exceeded or cancelled and the connection is still not established

if err != nil {
    t.opts.Logger.Error("dial", zap.String("remote", remote.String()), zap.String("addr", remoteAddr.String()), zap.Error(err))
    select {
    case <-retryCtx.Done():
    case <-dialCtx.Done():
        if !t.IsConnected(remote) {
        continue
    }
    }
}
rahulghangas commented 3 years ago

I read the code wrong. The issue is something else entirely