Acquire the send lock only while actually sending

[?]
Sep 1, 2017, 2:28 PM
FJCKDJKBQ3KRQEAQ2GX2HIPLA3NEXBJ4BB4MA6PYDEW7ZRHWAZJQC

Dependencies

  • [2] UYDRSHYR Don't wait forever to acquire the send lock
  • [3] 5AIYUMTB Basic remote building
  • [4] CNLNT3T4 Allow only 1 thread to send a closure to a given machine at the same time
  • [5] 73YR46NJ hydra-queue-runner: Write directly to a binary cache
  • [6] XCDTFZUY hydra-queue-runner: Fix build
  • [7] DIEY5USN Keep better bytesReceived/bytesSent stats
  • [8] RSISSEU6 Enable substitution on the build machines
  • [9] BYVRA54Q Temporarily disable machines on any exception, not just connection failures
  • [10] DKJFD6JN Process Nix API changes
  • [11] FITVNQ2S Keep track of the time we spend copying to/from build machines
  • [12] 6EO3HVNA Merge remote-tracking branch 'origin/master' into binary-cache
  • [*] 6TY4LNHH Finish copyClosure
  • [*] NAYQT2GT hydra-queue-runner: Use cmdBuildDerivation

Change contents

  • replacement in src/hydra-queue-runner/build-remote.cc at line 80
    [3.1290][3.123:171]()
    static void copyClosureTo(ref<Store> destStore,
    [3.1290]
    [3.1349]
    static void copyClosureTo(std::timed_mutex & sendMutex, ref<Store> destStore,
  • edit in src/hydra-queue-runner/build-remote.cc at line 110
    [14.286]
    [15.65]
    std::unique_lock<std::timed_mutex> sendLock(sendMutex,
    std::chrono::seconds(600));
  • edit in src/hydra-queue-runner/build-remote.cc at line 235
    [3.2711][2.0:127]()
    std::unique_lock<std::timed_mutex> sendLock(
    machine->state->sendLock, std::chrono::seconds(600));
  • replacement in src/hydra-queue-runner/build-remote.cc at line 241
    [3.56][3.3041:3103]()
    copyClosureTo(destStore, from, to, inputs, true);
    [3.56]
    [3.57]
    copyClosureTo(machine->state->sendLock, destStore, from, to, inputs, true);