timeout
timeout copied to clipboard
Server core dump with `fatal error: concurrent map writes`
I test gin-timeout, and it's ok
https://github.com/vearne/gin-timeout/blob/master/timeout.go#L33
cp := *c //nolint: govet
c.Abort()
// sync.Pool
buffer := buffpool.GetBuff()
tw := &TimeoutWriter{body: buffer, ResponseWriter: cp.Writer, h: make(http.Header)}
tw.TimeoutOptions = defaultOptions
// ....
cp.Writer = tw
So, Is it caused by gin reusing the ctx object?