-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error codes: clarify gRPC error code usage vs. CSI error code usage #18
Comments
This is up for debate, @saad-ali is looking into it |
Note that as the spec is written today, if we use the CSI error and not the gRPC error, then CreateVolume cannot be idempotent as claimed. The reason is that in the response, either a result or an error can be returned, but not both. So if CreateVolume gets called twice, there is no way for the plugin to return I think we should either make use of gRPC errors, or allow for returning status codes and response information in the same reply.
|
Although we've decided to use gRPC for CSI I think we should carefully consider the impact to "protocol adapters" each time we consider more tightly coupling the CSI spec to gRPC. For example, there's a standard, default status/error translator for the gRPC gateway service (that adapts REST-like RPCs to/from gRPC). That translator doesn't seem to include gRPC status While it's possible to build and plug-in a custom error translator for the gRPC gateway case (https://github.com/grpc-ecosystem/grpc-gateway/blob/7195ea445241f9773e71fc7b94c306d3ed6b35b6/runtime/errors.go#L60) I think this serves as a good example of how further coupling CSI to gRPC could impact downstream consumers that may adapt CSI to other protocols. I can pretty clearly see a case for a vendor needing/wanting to adapt gRPC calls to another protocol in order to reach out to an external, backend storage system. I don't think this is a huge red flag, just something I'd like for us to keep in mind. Ultimately it's the job of the CSI consumer to handle the potential pitfalls of adapting gRPC to some other protocol. It might be nice of us to consider such use cases when advancing the state of the spec. |
resolved by #115 |
gRPC has an error code mechanism that's independent of the CSI error code mechanism. Provide clarifying docs about error reporting expectations. Namely that CSI errors are returned with a successful/normal gRPC status: we explicitly do NOT mix gRPC errors and CSI errors.
The text was updated successfully, but these errors were encountered: