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 6, 2023
1 parent 8056053 commit 089b49c
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 connection")
}
}

Expand Down

0 comments on commit 089b49c

Please sign in to comment.