Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Backwards Incompatible Change: 0.5 Type RpcServerDriver Renamed to RPCServerDriver in 0.5.2 #2376

Closed
allingeek opened this issue Nov 21, 2015 · 3 comments

Comments

@allingeek
Copy link
Contributor

This change was made as part of a linting effort in 89d9854#diff-d5ccc4a4b6a6a35ee455ae55e7c7f6cc

The RPC server running in every plugin needs to provide service name / method name pairs that agree with the client (in this case Docker Machine). The plugin server uses net/rpc and the Register functino which uses the struct type as the service name, and each public function name as the method. Changing the type name changes the service registration with the RPC server, and thusly changes the named exposed. This makes the name of the RpcServerDriver part of the interface contract between docker-machine and every plugin.

Changing the name results backwards incompatibilities (new docker-machine, old plugins) like...

WARNING >>> Error attempting heartbeat call to plugin server: rpc: can't find service RPCServerDriver.Heartbeat
Error attempting to invoke binary for plugin 'digitalocean': rpc: can't find service RPCServerDriver.GetVersion

And forward incompatibilities (old docker-machine, new plugins) like...

WARNING >>> Error attempting heartbeat call to plugin server: rpc: can't find service RpcServerDriver.Heartbeat
Error attempting to invoke binary for plugin 'digitalocean': rpc: can't find service RpcServerDriver.GetVersion
@nathanleclaire
Copy link
Contributor

Hey @allingeek . Thanks for the report. We've been made previously aware (#2325) and are really sorry for this breaking change. The API / plugin effort is fairly new so please bear with us. We're working on defining guidelines and implementing regression testing to make sure it doesn't happen again in future versions.

@allingeek
Copy link
Contributor Author

@nathanleclaire Might I suggest a set of const string literals and using https://golang.org/pkg/net/rpc/#RegisterName? Then you'd be more free to iterate on implementation details like type names.

@nathanleclaire
Copy link
Contributor

@allingeek Good suggestion. In general I think we have several places in the codebase that could benefit from moving to const string or their own custom type instead of being hardcoded strings.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants