Remove bad daemon connections from the pool
This is necessary for long-running processes like hydra-queue-runner: if a nix-daemon worker is killed, we need to stop reusing that connection.
This commit is contained in:
parent
d5626bf4c1
commit
5f862658c3
4 changed files with 55 additions and 14 deletions
|
|
@ -40,7 +40,11 @@ template PathSet readStorePaths(Source & from);
|
|||
|
||||
|
||||
RemoteStore::RemoteStore(size_t maxConnections)
|
||||
: connections(make_ref<Pool<Connection>>(maxConnections, [this]() { return openConnection(); }))
|
||||
: connections(make_ref<Pool<Connection>>(
|
||||
maxConnections,
|
||||
[this]() { return openConnection(); },
|
||||
[](const ref<Connection> & r) { return r->to.good() && r->from.good(); }
|
||||
))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue