Pool local store connections
[?]
Feb 19, 2016, 11:04 PM
GJV2J5HXFKVF7BXNFMTI6ZZMYADXIKTFIQJ3FONJ7DPVCUJZ2L4ACDependencies
- [2]
XLYHZUHTCache .narinfo lookups - [3]
K5G5GZY7Guard against concurrent invocations of hydra-queue-runner - [4]
MHVIT4JYSplit hydra-queue-runner.cc more - [5]
32HHP5CWhydra-queue-runner: Support generating a signed binary cache - [6]
EOO4EFWDUse a single BinaryCacheStore for all threads - [7]
24BMQDZAStart of single-process hydra-queue-runner - [8]
YZAI5GQUImplement a database connection pool - [9]
5AIYUMTBBasic remote building - [10]
ATJ54SPXUse PostgreSQL notifications for queue events - [11]
GTUZLZRHAdd an S3-backed binary cache store - [12]
RND7XFNHgetQueuedBuilds(): Periodically stop to handle priority bumps - [13]
73YR46NJhydra-queue-runner: Write directly to a binary cache - [14]
N2NKSKHSRefactor local binary cache code into a subclass - [15]
W2AOTSS6Rename class - [16]
SOB276BAKeep some statistics for the binary cache stores - [17]
HJOEIMLRRefactor
Change contents
- replacement in src/hydra-queue-runner/binary-cache-store.cc at line 237
if (!localStore->isValidPath(storePath)) {if (!(*localStore)->isValidPath(storePath)) { - replacement in src/hydra-queue-runner/binary-cache-store.cc at line 241
ValidPathInfo info = localStore->queryPathInfo(storePath);ValidPathInfo info = (*localStore)->queryPathInfo(storePath); - replacement in src/hydra-queue-runner/binary-cache-store.cc at line 249
localStore->querySubstitutablePathInfos(left, infos);//(*localStore)->querySubstitutablePathInfos(left, infos); - replacement in src/hydra-queue-runner/binary-cache-store.cc at line 261
localStore->addTempRoot(storePath);(*localStore)->addTempRoot(storePath); - replacement in src/hydra-queue-runner/binary-cache-store.cc at line 263
if (!localStore->isValidPath(storePath))localStore->ensurePath(storePath);if (!(*localStore)->isValidPath(storePath))(*localStore)->ensurePath(storePath); - replacement in src/hydra-queue-runner/binary-cache-store.cc at line 266
ValidPathInfo info = localStore->queryPathInfo(storePath);ValidPathInfo info = (*localStore)->queryPathInfo(storePath); - edit in src/hydra-queue-runner/binary-cache-store.hh at line 8
#include "pool.hh" - replacement in src/hydra-queue-runner/binary-cache-store.hh at line 19
typedef std::function<ref<Store>()> StoreFactory;typedef Pool<nix::ref<nix::Store>> StorePool;typedef std::function<StorePool::Handle()> StoreFactory; - edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 21
: localStorePool([]() { return std::make_shared<ref<Store>>(openStore()); }) - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 30
ref<Store> State::getLocalStore()StorePool::Handle State::getLocalStore() - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 32
return openStore(); // FIXME: poolauto conn(localStorePool.get());return conn; - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 738
[]() { return openStore(); },"/home/eelco/Misc/Keys/test.nixos.org/secret","/home/eelco/Misc/Keys/test.nixos.org/public","nix-test-cache-3");;[this]() { return this->getLocalStore(); },"/home/eelco/hydra/secret","/home/eelco/hydra/public","nix-test-cache"); - edit in src/hydra-queue-runner/pool.hh at line 5
#include <functional> - edit in src/hydra-queue-runner/pool.hh at line 29
public:typedef std::function<std::shared_ptr<R>()> Factory; - edit in src/hydra-queue-runner/pool.hh at line 34
Factory factory; - edit in src/hydra-queue-runner/pool.hh at line 47
Pool(const Factory & factory = []() { return std::make_shared<R>(); }): factory(factory){ } - replacement in src/hydra-queue-runner/pool.hh at line 89
return Handle(*this, std::make_shared<R>());return Handle(*this, factory()); - replacement in src/hydra-queue-runner/queue-monitor.cc at line 39
bool done = getQueuedBuilds(*conn, localStore, destStore, lastBuildId);bool done = getQueuedBuilds(*conn, *localStore, destStore, lastBuildId); - edit in src/hydra-queue-runner/state.hh at line 18
#include "binary-cache-store.hh" // FIXME - edit in src/hydra-queue-runner/state.hh at line 351
/* Pool of local stores. */nix::StorePool localStorePool; - replacement in src/hydra-queue-runner/state.hh at line 364
nix::ref<nix::Store> getLocalStore();nix::StorePool::Handle getLocalStore();