aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-10-11 18:48:59 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-10-11 18:49:46 +0200
commit906d56a96b442d4dd8f924c1ce0d1eec0e214af3 (patch)
treefe0000090a33524295cba43a519816d3dc714dee /src/libstore
parent7d8c99eb438498b9912eabc238d5f9844f1adbcc (diff)
ssh-ng: Don't set CPU affinity on the remote
Fixes #3138.
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/remote-store.cc2
-rw-r--r--src/libstore/remote-store.hh5
-rw-r--r--src/libstore/ssh-store.cc3
3 files changed, 9 insertions, 1 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index b7f202a6b..f34369d8f 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -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
diff --git a/src/libstore/remote-store.hh b/src/libstore/remote-store.hh
index 82fbec092..1f375dd71 100644
--- a/src/libstore/remote-store.hh
+++ b/src/libstore/remote-store.hh
@@ -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. */
@@ -146,6 +148,9 @@ public:
std::string getUri() override;
+ bool sameMachine()
+ { return true; }
+
private:
ref<RemoteStore::Connection> openConnection() override;
diff --git a/src/libstore/ssh-store.cc b/src/libstore/ssh-store.cc
index 39205ae2c..93e117389 100644
--- a/src/libstore/ssh-store.cc
+++ b/src/libstore/ssh-store.cc
@@ -35,6 +35,9 @@ public:
return uriScheme + host;
}
+ bool sameMachine()
+ { return false; }
+
void narFromPath(const Path & path, Sink & sink) override;
ref<FSAccessor> getFSAccessor() override;