Allow only 1 thread to send a closure to a given machine at the same time
[?]
Jul 7, 2015, 12:04 PM
CNLNT3T4IXU42GAC64CU5CEDTDLM2SHSJZEVHTMOCWYFXSQNC76QCDependencies
- [2]
ED4M6GSCTypo - [3]
HJOEIMLRRefactor - [4]
N4IROACVMove buildRemote() into State - [5]
NJJ7H64SVery basic multi-threaded queue runner - [6]
7VQ4ALFYUpdate "make check" for the new queue runner - [7]
A2GL5FOZMoar stats - [8]
OG3Z3QGCNamespace cleanup - [9]
24BMQDZAStart of single-process hydra-queue-runner - [10]
6TY4LNHHFinish copyClosure - [11]
5AIYUMTBBasic remote building - [12]
OCZ4LSGGAutomatically retry aborted builds - [13]
LE4VZIY5More stats - [14]
MB3TISH2Rate-limit the number of threads copying closures at the same time
Change contents
- replacement in src/hydra-queue-runner/build-remote.cc at line 73
TokenServer & copyClosureTokenServer, counter & bytesSent,counter & bytesSent, - edit in src/hydra-queue-runner/build-remote.cc at line 101
/* Ensure that only a limited number of threads can copy closuresat the same time. However, proceed anyway after a timeout toprevent starvation by a handful of really huge closures. */time_t start = time(0);int timeout = 60 * (10 + rand() % 5);auto token(copyClosureTokenServer.get(timeout));time_t stop = time(0); - edit in src/hydra-queue-runner/build-remote.cc at line 102
if (token())printMsg(lvlDebug, format("got copy closure token after %1%s") % (stop - start));elseprintMsg(lvlDebug, format("did not get copy closure token after %1%s") % (stop - start)); - replacement in src/hydra-queue-runner/build-remote.cc at line 184
copyClosureTo(store, from, to, inputs, copyClosureTokenServer, bytesSent);std::lock_guard<std::mutex> sendLock(machine->state->sendLock);copyClosureTo(store, from, to, inputs, bytesSent); - edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 35
: copyClosureTokenServer{maxParallelCopyClosure} - edit in src/hydra-queue-runner/state.hh at line 15
#include "token-server.hh" - edit in src/hydra-queue-runner/state.hh at line 138
/* Mutex to prevent multiple threads from sending data to thesame machine (which would be inefficient). */std::mutex sendLock; - edit in src/hydra-queue-runner/state.hh at line 197
/* Token server limiting the number of threads copying closures inparallel to prevent excessive I/O load. */TokenServer copyClosureTokenServer;