Skip to content

Commit

Permalink
Fix non existing clients getting stacked up in overload scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickTaibel committed Oct 24, 2023
1 parent 73de69b commit 795f524
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion connection/connection_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
package connection

import (
"errors"
"rmux/graphite"
"rmux/log"
"strings"
Expand Down Expand Up @@ -117,7 +118,8 @@ func (cp *ConnectionPool) GetConnection() (connection *Connection, err error) {
}

return connection, nil
// TODO: Maybe a while/timeout/graphiteping loop?
case <-time.After(1 * time.Second):
return nil, errors.New("timeout while waiting for a new connection")
}
}

Expand Down

0 comments on commit 795f524

Please sign in to comment.