gin-contrib / timeout

Timeout middleware for Gin
MIT License
183 stars 37 forks source link

Server core dump with `fatal error: concurrent map writes` #60

Open x-lambda opened 1 year ago

x-lambda commented 1 year ago

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?