Closed hantmac closed 3 years ago
I found the solution in the other timeout implement. https://github.com/vearne/gin-timeout By injecting other Writer to the wrapped function, and using the select case to chose what to write.
I found the solution in the other timeout implement. https://github.com/vearne/gin-timeout By injecting other Writer to the wrapped function, and using the select case to chose what to write.
I saw it, but I think his code is so complicated 🤔.
Let me think about how to resolve the issue.
Any progress on fixing this?
Found a workaround until this is fixed.
Just check if the context is aborted anywhere else that attempts to write. Not ideal, but it worked for me.
Is it possible that gin's repo provides a func to copy or clone c.Writer.
Fix by #2
After timeout, the original goroutine still is running, and will cause panic finally.
The panic info is: