Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1166)

Issue 7782049: state: add dialTimeout parameter to state.Open (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 1 month ago by dave
Modified:
11 years, 1 month ago
Reviewers:
mp+154583
Visibility:
Public.

Description

state: add dialTimeout parameter to state.Open Updates LP#1084867 Remove the package level dialTimeout and replace it with a parameter passed to state.Open and state.Initalise. This is part 1 of 3 changes addressing jam's comments from https://codereview.appspot.com/7528047/#msg2. As jam suspected, we were not using the SetDialTimeout helper consistently, nor was it even available outside the state package. To resolve this the helper has been removed and replaced by an explicit value passed to state.Open and state.Initalise. The next proposal will build on this to pass a retryDelay value as originally proposed in https://codereview.appspot.com/7528047. The last proposal will address the heavy duplication of calls to state.Open/Initalise as a cleanup before reapplying https://codereview.appspot.com/7528047. https://code.launchpad.net/~dave-cheney/juju-core/107a-increase-timeout-delay/+merge/154583 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : state: add dialTimeout parameter to state.Open #

Total comments: 2

Patch Set 3 : state: add dialTimeout parameter to state.Open #

Patch Set 4 : state: add dialTimeout parameter to state.Open #

Total comments: 2

Patch Set 5 : state: add dialTimeout parameter to state.Open #

Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -55 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/jujud/bootstrap.go View 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujud/bootstrap_test.go View 5 chunks +5 lines, -5 lines 0 comments Download
M environs/agent/agent.go View 2 chunks +2 lines, -2 lines 0 comments Download
M environs/dummy/environs.go View 1 chunk +1 line, -1 line 0 comments Download
M juju/conn.go View 2 chunks +2 lines, -2 lines 0 comments Download
M juju/conn_test.go View 3 chunks +3 lines, -3 lines 0 comments Download
M state/conn_test.go View 1 2 1 chunk +1 line, -1 line 0 comments Download
M state/export_test.go View 1 2 2 chunks +4 lines, -10 lines 0 comments Download
M state/megawatcher_internal_test.go View 1 2 1 chunk +1 line, -1 line 0 comments Download
M state/open.go View 3 chunks +7 lines, -5 lines 0 comments Download
M state/settings_test.go View 1 2 1 chunk +1 line, -1 line 0 comments Download
M state/state_test.go View 1 2 15 chunks +19 lines, -19 lines 0 comments Download
M state/unit_test.go View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M worker/provisioner/provisioner_test.go View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 4
dave_cheney.net
Please take a look. https://codereview.appspot.com/7782049/diff/3001/cmd/jujud/bootstrap_test.go File cmd/jujud/bootstrap_test.go (right): https://codereview.appspot.com/7782049/diff/3001/cmd/jujud/bootstrap_test.go#newcode69 cmd/jujud/bootstrap_test.go:69: }, state.DefaultDialTimeout) note: this is ...
11 years, 1 month ago (2013-03-21 04:08:38 UTC) #1
fwereade
LGTM. Took me a while to figure out how Open worked with an unchanged body, ...
11 years, 1 month ago (2013-03-21 22:23:13 UTC) #2
wallyworld
LGTM, but see my one question about the timeout used in provisioner_test https://codereview.appspot.com/7782049/diff/4016/worker/provisioner/provisioner_test.go File worker/provisioner/provisioner_test.go ...
11 years, 1 month ago (2013-03-22 01:28:23 UTC) #3
dave_cheney.net
11 years, 1 month ago (2013-03-22 04:20:37 UTC) #4
*** Submitted:

state: add dialTimeout parameter to state.Open

Updates LP#1084867

Remove the package level dialTimeout and replace it with a parameter passed to
state.Open and state.Initalise.

This is part 1 of 3 changes addressing jam's comments from
https://codereview.appspot.com/7528047/#msg2. As jam suspected, we were not
using the SetDialTimeout helper consistently, nor was it even available outside
the state package. To resolve this the helper has been removed and replaced by
an explicit value passed to state.Open and state.Initalise.

The next proposal will build on this to pass a retryDelay value as originally
proposed in https://codereview.appspot.com/7528047. 

The last proposal will address the heavy duplication of calls to
state.Open/Initalise as a cleanup before reapplying
https://codereview.appspot.com/7528047.

R=fwereade, wallyworld
CC=
https://codereview.appspot.com/7782049

https://codereview.appspot.com/7782049/diff/4016/worker/provisioner/provision...
File worker/provisioner/provisioner_test.go (right):

https://codereview.appspot.com/7782049/diff/4016/worker/provisioner/provision...
worker/provisioner/provisioner_test.go:91: st, err := state.Open(o.Info,
state.DefaultDialTimeout)
On 2013/03/22 01:28:23, wallyworld wrote:
> Was using state.DefaultDialTimeout instead of TestingDialTimeout an oversight?

This wasn't so much an oversight as an attempt to make the old implicit
behaviour explicit. Because this code didn't live in the state/ package it could
not have access to the SetDialTimeout test helper. So, while we _thought_ that
because it was a test, it should have been using the shorter timeout, it was not
previously possible.

This is what jam was concerned about in my original proposal.

I'd like to leave this as is for the moment, as it doesn't change the previous
behaviour. It might be wrong, but at least it is consistently wrong, and we now
have a way to fix it in the future.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b