mirror of
https://github.com/NixOS/nix.git
synced 2025-11-16 23:42:43 +01:00
build-remote: Fix fallback to other machines when connecting fails
Opening an SSHStore or LegacySSHStore does not actually establish a connection, so the try/catch block here did nothing. Added a Store::connect() method to test whether a connection can be established.
This commit is contained in:
parent
1a68710d4d
commit
cd4d2705ec
5 changed files with 19 additions and 1 deletions
|
|
@ -100,7 +100,7 @@ ref<RemoteStore::Connection> UDSRemoteStore::openConnection()
|
|||
throw Error(format("socket path ‘%1%’ is too long") % socketPath);
|
||||
strcpy(addr.sun_path, socketPath.c_str());
|
||||
|
||||
if (connect(conn->fd.get(), (struct sockaddr *) &addr, sizeof(addr)) == -1)
|
||||
if (::connect(conn->fd.get(), (struct sockaddr *) &addr, sizeof(addr)) == -1)
|
||||
throw SysError(format("cannot connect to daemon at ‘%1%’") % socketPath);
|
||||
|
||||
conn->from.fd = conn->fd.get();
|
||||
|
|
@ -613,6 +613,12 @@ void RemoteStore::queryMissing(const PathSet & targets,
|
|||
}
|
||||
|
||||
|
||||
void RemoteStore::connect()
|
||||
{
|
||||
auto conn(connections->get());
|
||||
}
|
||||
|
||||
|
||||
RemoteStore::Connection::~Connection()
|
||||
{
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue