Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
juju: use new DNS caching functionality #7438
Conversation
|
!!build!! |
| @@ -0,0 +1,24 @@ | ||
| +package testing |
| @@ -0,0 +1,38 @@ | ||
| +package testing |
| - fakeUUID, | ||
| + dialed := make(chan string, 10) | ||
| + start := make(chan struct{}) | ||
| + // Wait for both dials to complete, so we |
| + }) | ||
| + c.Assert(err, jc.ErrorIsNil) | ||
| + start := make(chan struct{}) | ||
| + // Wait for both dials to complete, so we |
| -// addrsChanged returns true iff the two | ||
| -// slices are not equal. Order is important. | ||
| +// addrsChanged reports whether the two slices | ||
| +// are not equal. Order is important. |
| func (v Value) FindMethod(rootMethodName string, version int, objMethodName string) (MethodCaller, error) { | ||
| if !v.IsValid() { | ||
| panic("FindMethod called on invalid Value") | ||
| } | ||
| caller := methodCaller{ | ||
| rootValue: v.rootValue, | ||
| } | ||
| - if version != 0 { |
mhilton
Jun 2, 2017
Member
This seems like a bold change to make under the guise of DNS caching. It's probably a good idea, but its effects are far reaching. This should probably have its own PR.
rogpeppe
Jun 2, 2017
Owner
Value.FindMethod is only called once in the production code, with a zero version.
It's effects shouldn't be far reaching, but you're probably right that it should be
a separate PR.
rogpeppe
Jun 2, 2017
Owner
Nonetheless I'm going to land this anyway, as we need the fix in and I'm sure it's OK to do.
| // appropriate method will be called for every RPC request. | ||
| func NewConn(codec Codec, observerFactory ObserverFactory) *Conn { | ||
| + if observerFactory == nil { |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
rogpeppe commentedJun 1, 2017
juju: use new DNS caching functionality
We rely on the new API client functionality to do our
DNS resolving for us, and store any resulting cached
names in the controllers.yaml entry.
The UnresolvedAPIEndpoints field is now redundant
and is replaced by the strictly advisory DNSCache
field. The APIEndpoints field now always contains all
the host names returned from the Login call with
the exception of addresses deemed unusable
(e.g. link-local addresses).
We also change rpcreflect.Value.FindMethod to accept any
version so that it's more useful for testing - this makes it
possible to server limited portions of the juju API from
a mocked API type without implementing a custom FindMethod.
And, in passing, fix rpc.NewConn so that it works with a nil obververFactory
as documented.
QA check that API connections still work OK, particularly on
MAAS setups where some of the returned host names will
not resolve on a client.
Also, check that:
does not produce the "cannot validate certificate for because it
doesn't contain any IP SANs" error.
Fixes https://bugs.launchpad.net/juju/+bug/1692905