Skip to content

Commit

Permalink
ssh-ng: Don't set CPU affinity on the remote
Browse files Browse the repository at this point in the history
Fixes #3138.
  • Loading branch information
edolstra committed Oct 11, 2019
1 parent 7d8c99e commit 906d56a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/libstore/remote-store.cc
Expand Up @@ -151,7 +151,7 @@ void RemoteStore::initConnection(Connection & conn)
conn.to << PROTOCOL_VERSION;

if (GET_PROTOCOL_MINOR(conn.daemonVersion) >= 14) {
int cpu = settings.lockCPU ? lockToCurrentCPU() : -1;
int cpu = sameMachine() && settings.lockCPU ? lockToCurrentCPU() : -1;
if (cpu != -1)
conn.to << 1 << cpu;
else
Expand Down
5 changes: 5 additions & 0 deletions src/libstore/remote-store.hh
Expand Up @@ -29,6 +29,8 @@ public:
const Setting<unsigned int> maxConnectionAge{(Store*) this, std::numeric_limits<unsigned int>::max(),
"max-connection-age", "number of seconds to reuse a connection"};

virtual bool sameMachine() = 0;

RemoteStore(const Params & params);

/* Implementations of abstract store API methods. */
Expand Down Expand Up @@ -146,6 +148,9 @@ public:

std::string getUri() override;

bool sameMachine()
{ return true; }

private:

ref<RemoteStore::Connection> openConnection() override;
Expand Down
3 changes: 3 additions & 0 deletions src/libstore/ssh-store.cc
Expand Up @@ -35,6 +35,9 @@ class SSHStore : public RemoteStore
return uriScheme + host;
}

bool sameMachine()
{ return false; }

void narFromPath(const Path & path, Sink & sink) override;

ref<FSAccessor> getFSAccessor() override;
Expand Down

0 comments on commit 906d56a

Please sign in to comment.