Merge lp:~axwalk/juju-core/state-dialtimeout into lp:~go-bot/juju-core/trunk
Status: | Merged |
---|---|
Approved by: | Andrew Wilkins |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2702 |
Proposed branch: | lp:~axwalk/juju-core/state-dialtimeout |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
26 lines (+6/-3) 1 file modified
state/open.go (+6/-3) |
To merge this branch: | bzr merge lp:~axwalk/juju-core/state-dialtimeout |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+218568@code.launchpad.net |
Commit message
state: reduce default dial timeout to 30s
Previously we could have been dialling state connections
across the Internet, since the CLI would connect to Mongo
directly. Now, with the CLI going to API only, we can
safely reduce the timeout.
It is possible that the timeout will be exceeded if the
peers in an HA setup are not all ready. In this case the
dial operation will fail and the caller (state server agent)
will restart.
This change will reduce the time to failure in tests, and
allow us to capture some information about the failed test
without exceeding the Go test timeout.
Description of the change
state: reduce default dial timeout to 30s
Previously we could have been dialling state connections
across the Internet, since the CLI would connect to Mongo
directly. Now, with the CLI going to API only, we can
safely reduce the timeout.
It is possible that the timeout will be exceeded if the
peers in an HA setup are not all ready. In this case the
dial operation will fail and the caller (state server agent)
will restart.
This change will reduce the time to failure in tests, and
allow us to capture some information about the failed test
without exceeding the Go test timeout.
Reviewers: mp+218568_ code.launchpad. net,
Message:
Please take a look.
Description:
state: reduce default dial timeout to 30s
Previously we could have been dialling state connections
across the Internet, since the CLI would connect to Mongo
directly. Now, with the CLI going to API only, we can
safely reduce the timeout.
It is possible that the timeout will be exceeded if the
peers in an HA setup are not all ready. In this case the
dial operation will fail and the caller (state server agent)
will restart.
This change will reduce the time to failure in tests, and
allow us to capture some information about the failed test
without exceeding the Go test timeout.
https:/ /code.launchpad .net/~axwalk/ juju-core/ state-dialtimeo ut/+merge/ 218568
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/97100045/
Affected files (+8, -3 lines):
A [revision details]
M state/open.go
Index: [revision details] 20140506233919- 52y6gttu34ucqsh o
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: state/open.go
=== modified file 'state/open.go'
--- state/open.go 2014-04-18 11:46:22 +0000
+++ state/open.go 2014-05-07 08:10:22 +0000
@@ -32,6 +32,11 @@
// default.
const mongoSocketTimeout = 10 * time.Second
+// defaultDialTimeout should be representative of
+// the upper bound of time taken to dial a mongo
+// server from within the same cloud/private network.
+const defaultDialTimeout = 30 * time.Second
+
// Info encapsulates information about cluster of
// servers holding juju state and can be used to make a
// connection to that cluster.
@@ -63,9 +68,7 @@
// DefaultDialOpts returns a DialOpts representing the default
// parameters for contacting a state server.
func DefaultDialOpts() DialOpts {
- return DialOpts{
- Timeout: 10 * time.Minute,
- }
+ return DialOpts{Timeout: defaultDialTimeout}
}
// Open connects to the server described by the given