Skip to content

Commit

Permalink
improve transport logic (#1519)
Browse files Browse the repository at this point in the history
* skip stopping on encrypted error

* update skywire utilities

* keep transport.manager module running till shutdown complete, actually no timeout
  • Loading branch information
mrpalide committed Mar 16, 2023
1 parent af207b0 commit 12a0719
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ require (
github.com/lib/pq v1.10.7
github.com/pterm/pterm v0.12.49
github.com/skycoin/dmsg v1.3.0-rc1.0.20230224131835-1c194ef9791e
github.com/skycoin/skywire-utilities v0.0.0-20230110132024-c5536ba8e22c
github.com/skycoin/skywire-utilities v0.0.0-20230315234948-7c62dc34c53a
github.com/skycoin/systray v1.10.0
github.com/spf13/pflag v1.0.5
github.com/zcalusic/sysinfo v0.9.5
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,8 @@ github.com/skycoin/skycoin v0.27.1 h1:HatxsRwVSPaV4qxH6290xPBmkH/HgiuAoY2qC+e8C9
github.com/skycoin/skycoin v0.27.1/go.mod h1:78nHjQzd8KG0jJJVL/j0xMmrihXi70ti63fh8vXScJw=
github.com/skycoin/skywire-utilities v0.0.0-20230110132024-c5536ba8e22c h1:jYHyLwSyRVR/TmT4WWIGAeFX4FawGHA4Gaeic0zX3KI=
github.com/skycoin/skywire-utilities v0.0.0-20230110132024-c5536ba8e22c/go.mod h1:X5H+fKC3rD11/sm4t9V2FWy/aet7OdEilaO2Ar3waXY=
github.com/skycoin/skywire-utilities v0.0.0-20230315234948-7c62dc34c53a h1:hTqQ+8G/2Y+vd4qXoTbm7gfj+mjil2zDnGSS8i8V4LQ=
github.com/skycoin/skywire-utilities v0.0.0-20230315234948-7c62dc34c53a/go.mod h1:X5H+fKC3rD11/sm4t9V2FWy/aet7OdEilaO2Ar3waXY=
github.com/skycoin/systray v1.10.0 h1:fQZJHMylpVvfmOOTLvUssfyHVDoC8Idx6Ba2BlLEuGg=
github.com/skycoin/systray v1.10.0/go.mod h1:/i17Eni5GxFiboIZceeamY5LktDSFFRCvd3fBMerQ+4=
github.com/skycoin/yamux v0.0.0-20200803175205-571ceb89da9f h1:A5dEM1OE9YhN3LciZU9qPjo7fJ46JeHNi3JCroDkK0Y=
Expand Down
2 changes: 1 addition & 1 deletion pkg/transport/network/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func (c *genericClient) acceptTransports(lis net.Listener) {
c.log.Debugf("listening on addr: %v", c.connListener.Addr())
for {
if err := c.acceptTransport(); err != nil {
if errors.Is(err, io.EOF) {
if errors.Is(err, io.EOF) || strings.Contains(err.Error(), "encrypt connection to") {
continue // likely it's a dummy connection from service discovery
}

Expand Down
5 changes: 5 additions & 0 deletions pkg/visor/visor.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,11 @@ func (v *Visor) Close() error {
errCh := make(chan error, 1)
t := time.NewTimer(moduleShutdownTimeout)

// should keep transport.manager shutdown continue till all transports delete there
if cl.src == "transport.manager" {
t = time.NewTimer(2 * time.Hour)
}

log := v.MasterLogger().PackageLogger(fmt.Sprintf("visor:shutdown:%s", cl.src)).
WithField("func", fmt.Sprintf("[%d/%d]", i+1, len(v.closeStack)))
log.Debug("Shutting down module...")
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions vendor/github.com/skycoin/skywire-utilities/pkg/skyenv/values.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ github.com/skycoin/skycoin/src/cipher/ripemd160
github.com/skycoin/skycoin/src/cipher/secp256k1-go
github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2
github.com/skycoin/skycoin/src/util/logging
# github.com/skycoin/skywire-utilities v0.0.0-20230110132024-c5536ba8e22c
# github.com/skycoin/skywire-utilities v0.0.0-20230315234948-7c62dc34c53a
## explicit; go 1.17
github.com/skycoin/skywire-utilities/pkg/buildinfo
github.com/skycoin/skywire-utilities/pkg/cipher
Expand Down

0 comments on commit 12a0719

Please sign in to comment.