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
context: (*cancelCtx).Done() channel type assertion error #60681
Comments
gin has a custom context implementation, have you ruled out it being the source of error? |
Have you tried running the program under the race detector? (Does it flag anything?) |
@seankhliao If the context you mentioned is the Furthermore, you can check the stack trace to see that the panic occurred inside the go native cancellable context. It is true that the context created by gin serves as the parent context, as many middlewares recreate child contexts from it using the Additionally, it is strange that the panic message does not display the actual type of the "done" channel (it is definitely not nil). How is this possible? Could it be due to unsafe pointer operations? If we are missing any detailed knowledge about gin, please provide us with that information. Thank you. |
@bcmills No, I haven't tried that yet, but I can set it up and run with it. Is it sufficient to build the application with the |
Yep, that should do the trick. Thanks! |
It's not.
Yes. |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
This issue appears sporadically and a consistent method of reproduction has not yet been identified.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
We're building our server application using the golang:1.19-alpine3.17 Docker image and running it on alpine:3.17, as outlined in the attached Dockerfile:
Dockerfile
The application is an HTTP server based on gin v1.7.7, handling an average of 1K RPM (requests per minute) per container in our AWS EKS setup.
Our deployment includes liveness and readiness health checkers on each pod. These checkers execute simple HTTP requests and expect a
200 OK
response. This HTTP request invokes a basic handler logic that returns a200 OK
status without any business-related processing. Of course, the application also has numerous endpoints for actual business operations.Issue Description
Since May 31, we've encountered an error serveral times, evidenced by the attached stacktrace.
This specific error occurred on four seperate occasions: May 31, Jun 4, Jun 5, and Jun 8.
(Note that the docker image we're using updated golang version to 1.19.9 on May 3, and then to 1.19.10 on Jun 7, but Jun 8 case was using 1.19.9 yet)
Importantly, all four instances of this panic occurred while processing the health check endpoint.
The root of the panic seems to originate from the code found at
File "/usr/local/go/src/context/context.go", line 361
:But we have not yet determined why this type conversion cannot be done.
And, the most interesting part is the panic message:
The actual type of the
interface {}
is not specified in the message - it merely appears as an empty string betweenis
and,
.As this panic occurs only sporadically and is not currently reproducible, we're seeking insights from anyone who might have experienced a similar issue. If additional information is required for debugging, let us know what further data we can collect from our production application and how to get it.
The text was updated successfully, but these errors were encountered: