Skip to content

Commit

Permalink
Merge pull request #454 from nkryuchkov/fix/rpc-timeouts
Browse files Browse the repository at this point in the history
Fix visor RPC timeouts
  • Loading branch information
jdknives committed Jul 31, 2020
2 parents 286c186 + b871dc2 commit d225258
Show file tree
Hide file tree
Showing 15 changed files with 621 additions and 61 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.14

require (
github.com/AudriusButkevicius/pfilter v0.0.0-20190627213056-c55ef6137fc6
github.com/SkycoinProject/dmsg v0.2.3-0.20200626071453-e2e73212a9ab
github.com/SkycoinProject/dmsg v0.2.3
github.com/SkycoinProject/skycoin v0.27.0
github.com/SkycoinProject/yamux v0.0.0-20191213015001-a36efeefbf6a
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ github.com/AudriusButkevicius/pfilter v0.0.0-20190627213056-c55ef6137fc6 h1:Apvc
github.com/AudriusButkevicius/pfilter v0.0.0-20190627213056-c55ef6137fc6/go.mod h1:1N0EEx/irz4B1qV17wW82TFbjQrE7oX316Cki6eDY0Q=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/SkycoinProject/dmsg v0.2.3-0.20200626071453-e2e73212a9ab h1:Tk6A+wHK/geAOZcwcvpKsVRtEGz91y2FM6Y6ePtt0/M=
github.com/SkycoinProject/dmsg v0.2.3-0.20200626071453-e2e73212a9ab/go.mod h1:qLrCsFiggHokPHyHH8069v6DawaD16SiUc8ml9W7CEo=
github.com/SkycoinProject/dmsg v0.2.3 h1:x6Wok/CXnAWdngMQ1q0sOiP81r9G21EeP4jnDfxEEJk=
github.com/SkycoinProject/dmsg v0.2.3/go.mod h1:qLrCsFiggHokPHyHH8069v6DawaD16SiUc8ml9W7CEo=
github.com/SkycoinProject/skycoin v0.27.0 h1:N3IHxj8ossHOcsxLYOYugT+OaELLncYHJHxbbYLPPmY=
github.com/SkycoinProject/skycoin v0.27.0/go.mod h1:xqPLOKh5B6GBZlGA7B5IJfQmCy7mwimD9NlqxR3gMXo=
github.com/SkycoinProject/yamux v0.0.0-20191213015001-a36efeefbf6a h1:6nHCJqh7trsuRcpMC5JmtDukUndn2VC9sY64K6xQ7hQ=
Expand Down
7 changes: 4 additions & 3 deletions pkg/skyenv/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ const (

// RPC constants.
const (
DefaultRPCAddr = "localhost:3435"
DefaultRPCTimeout = 20 * time.Second
LongRPCTimeout = 5 * time.Minute // update requires huge timeout
DefaultRPCAddr = "localhost:3435"
DefaultRPCTimeout = 20 * time.Second
TransportRPCTimeout = 1 * time.Minute
UpdateRPCTimeout = 6 * time.Hour // update requires huge timeout
)

// Default skywire app server and discovery constants
Expand Down
6 changes: 4 additions & 2 deletions pkg/visor/rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ func (rc *rpcClient) Call(method string, args, reply interface{}) error {
timeout := rc.timeout

switch method {
case "Update", "AddTransport":
timeout = skyenv.LongRPCTimeout
case "AddTransport":
timeout = skyenv.TransportRPCTimeout
case "Update":
timeout = skyenv.UpdateRPCTimeout
}

if timeout != 0 {
Expand Down
2 changes: 2 additions & 0 deletions vendor/github.com/SkycoinProject/dmsg/.gitignore

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

4 changes: 4 additions & 0 deletions vendor/github.com/SkycoinProject/dmsg/README.md

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

297 changes: 297 additions & 0 deletions vendor/github.com/SkycoinProject/dmsg/cmdutil/service_flags.go

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

12 changes: 10 additions & 2 deletions vendor/github.com/SkycoinProject/dmsg/disc/entry.go

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

Loading

0 comments on commit d225258

Please sign in to comment.