Skip to content
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

Out-of-range status codes should be coalesced to "UNKNOWN" #1672

Closed
dfawley opened this issue Nov 14, 2017 · 4 comments
Closed

Out-of-range status codes should be coalesced to "UNKNOWN" #1672

dfawley opened this issue Nov 14, 2017 · 4 comments
Assignees

Comments

@dfawley
Copy link
Member

dfawley commented Nov 14, 2017

Per grpc/grpc#13321 (comment), we should not set the status code to an out-of-range value; we should force it to UNKNOWN when that happens instead.

jeanbza added a commit to jeanbza/grpc-go that referenced this issue Feb 16, 2018
jeanbza added a commit to jeanbza/grpc-go that referenced this issue Feb 16, 2018
jeanbza added a commit to jeanbza/grpc-go that referenced this issue Feb 16, 2018
@jeanbza
Copy link
Member

jeanbza commented Feb 16, 2018

The linked PRs should cover all codes. There were many instances of the first two codes in the list (NOT_FOUND, INVALID_ARGUMENT) which is why I created separate PRs, but then the rest of the errors had hardly any occurrences heh. Oh well. Let me know if you'd like me to merge them.

@jeanbza
Copy link
Member

jeanbza commented Feb 22, 2018

@menghanl I believe this is finished, now

@menghanl
Copy link
Contributor

@jadekler we still return unexpected code in function convertCode, including OutOfRange.

grpc-go/go17.go

Lines 76 to 85 in 583a630

func convertCode(err error) codes.Code {
switch err {
case nil:
return codes.OK
case io.EOF:
return codes.OutOfRange
case io.ErrClosedPipe, io.ErrNoProgress, io.ErrShortBuffer, io.ErrShortWrite, io.ErrUnexpectedEOF:
return codes.FailedPrecondition
case os.ErrInvalid:
return codes.InvalidArgument

@jeanbza
Copy link
Member

jeanbza commented Feb 22, 2018

Shoot good point. I'll fix that tn

jeanbza added a commit to jeanbza/grpc-go that referenced this issue Mar 6, 2018
jeanbza added a commit to jeanbza/grpc-go that referenced this issue Mar 6, 2018
jeanbza added a commit to jeanbza/grpc-go that referenced this issue Mar 6, 2018
jeanbza added a commit to jeanbza/grpc-go that referenced this issue Mar 8, 2018
dfawley pushed a commit that referenced this issue Mar 8, 2018
@jeanbza jeanbza self-assigned this Mar 12, 2018
@jeanbza jeanbza closed this as completed Mar 12, 2018
lyuxuan pushed a commit to lyuxuan/grpc-go that referenced this issue Apr 4, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Sep 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants