Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default normalRefire duration in pathmgr #3387

Merged
merged 1 commit into from
Nov 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go/lib/pathmgr/pathmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (timers *Timers) GetWait(isError bool) time.Duration {

const (
// DefaultNormalRefire is the wait time after a successful path lookup (for periodic lookups)
DefaultNormalRefire = time.Minute
DefaultNormalRefire = 10 * time.Second
// DefaultErorrRefire is the wait time after a failed path lookup (for periodic lookups)
DefaultErrorRefire = time.Second
// DefaultQueryTimeout is the time allocated for a query to SCIOND
Expand Down
8 changes: 1 addition & 7 deletions go/lib/snet/snet.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,7 @@ func getResolver(sciondPath string) (pathmgr.Resolver, error) {
if err != nil {
return nil, common.NewBasicError("Unable to initialize SCIOND service", err)
}
pathResolver = pathmgr.New(
sciondConn,
pathmgr.Timers{
NormalRefire: time.Minute,
ErrorRefire: 3 * time.Second,
},
)
pathResolver = pathmgr.New(sciondConn, pathmgr.Timers{})
}
return pathResolver, nil
}
Expand Down
1 change: 1 addition & 0 deletions go/sig/sigcmn/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ go_library(
"//go/lib/addr:go_default_library",
"//go/lib/common:go_default_library",
"//go/lib/env:go_default_library",
"//go/lib/log:go_default_library",
"//go/lib/pathmgr:go_default_library",
"//go/lib/snet:go_default_library",
"//go/lib/sock/reliable:go_default_library",
Expand Down
8 changes: 4 additions & 4 deletions go/sig/sigcmn/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/scionproto/scion/go/lib/addr"
"github.com/scionproto/scion/go/lib/common"
"github.com/scionproto/scion/go/lib/env"
"github.com/scionproto/scion/go/lib/log"
"github.com/scionproto/scion/go/lib/pathmgr"
"github.com/scionproto/scion/go/lib/snet"
"github.com/scionproto/scion/go/lib/sock/reliable"
Expand Down Expand Up @@ -57,22 +58,21 @@ func Init(cfg sigconfig.SigConf, sdCfg env.SciondClient) error {
encapPort = cfg.EncapPort

ds := reliable.NewDispatcherService(cfg.Dispatcher)

// TODO(karampok). To be kept until https://github.com/scionproto/scion/issues/3377
wait := func() (*snet.SCIONNetwork, error) {
deadline := time.Now().Add(sdCfg.InitialConnectPeriod.Duration)
var retErr error
for tries := 0; time.Now().Before(deadline); tries++ {
n, err := snet.NewNetwork(cfg.IA, sdCfg.Path, ds)
if err == nil {
return n, nil // success
return n, nil
}
log.Debug("SIG is retrying to get NewNetwork", err)
retErr = err
time.Sleep(time.Second << uint(tries)) // exponential back-off
time.Sleep(time.Second)
}
return nil, retErr
}

network, err := wait()
if err != nil {
return common.NewBasicError("Error creating local SCION Network context", err)
Expand Down