diff options
Diffstat (limited to 'modules/graceful/server.go')
-rw-r--r-- | modules/graceful/server.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/graceful/server.go b/modules/graceful/server.go index 09be933999..4d0d8677f0 100644 --- a/modules/graceful/server.go +++ b/modules/graceful/server.go @@ -250,6 +250,17 @@ type wrappedConn struct { func (w wrappedConn) Close() error { if atomic.CompareAndSwapInt32(w.closed, 0, 1) { + defer func() { + if err := recover(); err != nil { + select { + case <-GetManager().IsHammer(): + // Likely deadlocked request released at hammertime + log.Warn("Panic during connection close! %v. Likely there has been a deadlocked request which has been released by forced shutdown.", err) + default: + log.Error("Panic during connection close! %v", err) + } + } + }() w.server.wg.Done() } return w.Conn.Close() |