-
Notifications
You must be signed in to change notification settings - Fork 137
Conversation
f5974de
to
597db4b
Compare
@@ -1,6 +1,7 @@ | |||
{ | |||
"zk": "zk://127.0.0.1:2181/mesos", | |||
"masters": ["127.0.0.1:5050"], | |||
"StateTimeout": 300, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably better named stateTimeoutSeconds
(lowercase, and express the unit)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. I'm going to set the field as StateTimeoutSeconds in JSON, rather than using a JSON Tag.
initial review complete |
597db4b
to
19cf777
Compare
@@ -67,26 +69,27 @@ type Config struct { | |||
// NewConfig return the default config of the resolver | |||
func NewConfig() Config { | |||
return Config{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gofmt shifted everything over due to a longer field
19cf777
to
9f8ac93
Compare
if rip := leaderIP(sj.Leader); rip != ip { | ||
logging.VeryVerbose.Println("Warning: master changed to " + ip) | ||
sj = rg.loadFromMaster(rip, port) | ||
sj, err = rg.loadFromMaster(rip, port) | ||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need this if
? can't you just return sj, err
?
0f603b5
to
65574e9
Compare
@@ -164,6 +169,7 @@ func testRecordGenerator(t *testing.T, spec labels.Func, ipSources []string) Rec | |||
if err != nil { | |||
t.Fatal(err) | |||
} else if err = json.Unmarshal(b, &sj); err != nil { | |||
t.Log("err: ", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is strange: we're already logging the error w/ t.Fatal(), why the additional t.Log()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea how this snuck in. Getting rid of it.
nits: otherwise lgtm |
65574e9
to
8d2e008
Compare
- Adds an integration test to ensure the timeouts work correctly - Introduces a new configuration flag: StateTimeoutSeconds - Adds stateTimeoutSeconds variable to config.json.sample
8d2e008
to
bc1672f
Compare
Add Timeout when fetching state.json
Fixes #243