Open irfansharif opened 3 years ago
Is there anything blocking this? This would be great!
+cc @erikgrinaker.
Can someone (@ajwerner ?) please spell out how this issue depends on #56378 (as per https://github.com/cockroachdb/cockroach/issues/56378#issuecomment-780923105) ?
I don't know about https://github.com/cockroachdb/cockroach/issues/56378. I was just hoping to fix some string matching on grpc errors when I stumbled into this.
@erikgrinaker I think you've completed this right? Is there still work to do?
Lots of work to do. We will basically have to add Protobuf serialization support for all relevant structured errors, make sure they can reliably traverse gRPC boundaries, and replace all the error string matching we currently do with structured error matching.
We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!
We currently have code in CRDB that looks like the following: https://github.com/cockroachdb/cockroach/blob/9ba4404813cd68b5adf3e16cfb589eb355a778cb/pkg/cli/error.go#L356-L364
We're essentially string matching on the specific error and using that in our control flow; it makes for fragile code. As of https://github.com/cockroachdb/errors/pull/14, our errors package now has the infrastructure to support error serialization in gRPC. It'd be nice to implement it and start promoting this
errors.Is(...)
usage pattern across RPC boundaries, in the same way we do for "local" errors.Jira issue: CRDB-2971