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
net: mapErr causes panic #60029
Comments
Change https://go.dev/cl/493238 mentions this issue: |
Reads from a nil channel block forever, so if |
I think there is a custom context, so I'll look into that. Below is the stack trace from the panic in production. We're only seeing this panic in production. We're unable to reproduce it locally or in any other environment.
|
Hi @seankhliao, Since |
no, as I mentioned before, a nil channel blocks forever, which is the correct behavior here |
I appreciate your patience. Let me ask a different question. It seems like |
https://pkg.go.dev/context#Context
The case is only triggered when Done is closed, so Err must return a non nil error. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
We are running a service that communicates with another service. I created a repository to maybe help explain.
What did you expect to see?
No issues.
What did you see instead?
It points to the
mapErr
function call in lookup.go. It seems like if themapErr
function is passed anil
, then it will panic. I'm not sure if this would be a race issue or what, but it's been difficult to troubleshoot.ctx.Done()
returns // Done may return nil if this context can never be canceled.ctx.Err()
returns nil // If Done is not yet closed, Err returns nil.mapErr
causes a panicThe text was updated successfully, but these errors were encountered: