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

Issue 13249054: rpc: implement introspection

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 7 months ago by rog
Modified:
10 years, 7 months ago
Reviewers:
axw1, fwereade, mp+186909
Visibility:
Public.

Description

rpc: implement introspection This unearths an old branch that provided introspection into the methods provided by the rpc package. I've moved all the rpc method introspection stuff into a new package, rpc/rpcreflect, that has a number of potentially interesting use cases. The "discarded method" log warnings are now gone; an upcoming branch will add a test to state/apiserver/* that exactly the expected methods are discarded. https://code.launchpad.net/~rogpeppe/juju-core/411-rpc-introspection/+merge/186909 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : rpc: implement introspection #

Patch Set 3 : rpc: implement introspection #

Patch Set 4 : rpc: implement introspection #

Patch Set 5 : rpc: implement introspection #

Patch Set 6 : rpc: implement introspection #

Total comments: 7

Patch Set 7 : rpc: implement introspection #

Patch Set 8 : rpc: implement introspection #

Patch Set 9 : rpc: implement introspection #

Unified diffs Side-by-side diffs Delta from patch set Stats (+332 lines, -146 lines) Patch
A [revision details] View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M rpc/rpc_test.go View 1 2 8 chunks +105 lines, -15 lines 0 comments Download
M rpc/rpcreflect/methods.go View 1 2 3 4 5 6 7 8 7 chunks +206 lines, -97 lines 0 comments Download
M rpc/server.go View 1 2 6 chunks +17 lines, -28 lines 0 comments Download
M state/apiserver/admin.go View 1 chunk +1 line, -3 lines 0 comments Download
M state/apiserver/apiserver.go View 1 chunk +1 line, -3 lines 0 comments Download

Messages

Total messages: 9
rog
Please take a look.
10 years, 7 months ago (2013-09-21 06:03:02 UTC) #1
rog
Please take a look.
10 years, 7 months ago (2013-09-22 19:16:29 UTC) #2
rog
Please take a look.
10 years, 7 months ago (2013-09-22 19:49:45 UTC) #3
axw1
LGTM, though you might want to wait for someone better versed in this code. https://codereview.appspot.com/13249054/diff/13001/rpc/rpcreflect/methods.go ...
10 years, 7 months ago (2013-09-23 07:26:52 UTC) #4
rog
Please take a look. https://codereview.appspot.com/13249054/diff/13001/rpc/rpcreflect/methods.go File rpc/rpcreflect/methods.go (right): https://codereview.appspot.com/13249054/diff/13001/rpc/rpcreflect/methods.go#newcode49 rpc/rpcreflect/methods.go:49: var names []string On 2013/09/23 ...
10 years, 7 months ago (2013-09-23 09:06:29 UTC) #5
rog
Please take a look.
10 years, 7 months ago (2013-09-23 09:08:55 UTC) #6
fwereade
LGTM, very nice. But I think we do want to identify the missing method :). ...
10 years, 7 months ago (2013-09-23 09:10:01 UTC) #7
rog
Please take a look.
10 years, 7 months ago (2013-09-23 09:35:44 UTC) #8
rog
10 years, 7 months ago (2013-09-23 09:36:38 UTC) #9
On 23 September 2013 10:10,  <fwereade@gmail.com> wrote:
> LGTM, very nice.
>
> But I think we do want to identify the missing method :).
>
>
>
> https://codereview.appspot.com/13249054/diff/13001/rpc/rpcreflect/methods.go
> File rpc/rpcreflect/methods.go (right):
>
>
https://codereview.appspot.com/13249054/diff/13001/rpc/rpcreflect/methods.go#...
> rpc/rpcreflect/methods.go:62: return RootMethod{}, ErrMethodNotFound
> On 2013/09/23 07:26:52, axw1 wrote:
>>
>> Should this error message not include the input name?
>
>
> If it does, and a client annotates the error with the context it knows,
> you get a nasty stuttery error message. If it doesn't, and nor does the
> client, you get a nasty useless error message.  The latter would seem to
> be strictly worse that the former, and given that the method's exposed
> (and so we can't control further annotations) it seems like we really
> should include the name.

As discussed online, I left it as is, but changed the docs to make it
more obvious
that it's the only error that can be returned.
Sign in to reply to this message.

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