temporalio / temporalio/temporal
grpc Status response to query errors contains malformed details
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.2k
- Forks
- 1.9k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 228
Description
I went to try to finish https://github.com/temporalio/sdk-core/issues/867 real quick only to find it's very difficult to inspect the full Failure responses in anything other than Go.
When you get back from a client query call looks like this:
[core/../tests/integ_tests/queries_tests.rs:273:5] &q_resp = Status {
code: InvalidArgument,
message: "oh no broken",
details: b"\x08\x03\x12\x0coh no broken\x1a\\\nCtype.googleapis.com/temporal.api.errordetails.v1.QueryFailedFailure\x12\x15\n\x13\n\x0coh no broken\x12\x03src",
metadata: MetadataMap {
headers: {
"content-type": "application/grpc",
},
},
source: None,
}
There are a few issues here:
https://github.com/temporalio/api/blob/master/temporal/api/workflowservice/v1/service.proto#L551 's comment should say something about how the encoded failure is packed into the Status details field, which ostensibly, should be that it follows the guidance here: https://google.aip.dev/193#statusdetails and attaches some an Any containing an ErrorInfo followed by an Any Wrapping a QueryFailedFailure
AFAICT it's not doing that, though. I can't actually tell how this binary string is constructed. Luckily no SDK is using this yet so we can fix it. If it's not following the guidance (maybe it is and somehow I'm just not unpacking it right, but I don't think so), we should adhere to that.
From my reading of the binary it looks like it's just directly serializing a https://github.com/temporalio/api-go/blob/master/serviceerror/query_failed.go#L35 somehow, which maybe is OK for api-go users, but isn't for anyone else.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the query response test at core/../tests/integ_tests/queries_tests.rs:273, then inspect the service.proto comment at the linked API location and api-go/serviceerror/query_failed.go. Compare the encoded Status details with AIP-193. Done means the response follows the documented Any/ErrorInfo and QueryFailedFailure structure and the protocol comment explains it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, grpc
- Domain
- api, backend-api-design, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100