Minimal fixes for metrics

This commit is contained in:
2026-03-02 23:26:57 +01:00
parent 8c9cd96213
commit c03bd3e3a2
5 changed files with 22 additions and 10 deletions

View File

@@ -661,13 +661,12 @@ func (l *limitedListener) Accept() (net.Conn, error) {
l.slots <- struct{}{}
metrics.Default.DecRequestQueueLength()
}
metrics.Default.IncConnectionPoolActive()
conn, err := l.Listener.Accept()
if err != nil {
<-l.slots
metrics.Default.DecConnectionPoolActive()
return nil, err
}
metrics.Default.IncConnectionPoolActive()
return &limitedConn{
Conn: conn,
done: func() {