Don't wait forever to acquire the send lock
This commit is contained in:
parent
b405837d4d
commit
50ab80caf2
2 changed files with 3 additions and 2 deletions
|
@ -229,7 +229,8 @@ void State::buildRemote(ref<Store> destStore,
|
||||||
/* Copy the input closure. */
|
/* Copy the input closure. */
|
||||||
if (/* machine->sshName != "localhost" */ true) {
|
if (/* machine->sshName != "localhost" */ true) {
|
||||||
auto mc1 = std::make_shared<MaintainCount>(nrStepsWaiting);
|
auto mc1 = std::make_shared<MaintainCount>(nrStepsWaiting);
|
||||||
std::lock_guard<std::mutex> sendLock(machine->state->sendLock);
|
std::unique_lock<std::timed_mutex> sendLock(
|
||||||
|
machine->state->sendLock, std::chrono::seconds(600));
|
||||||
mc1.reset();
|
mc1.reset();
|
||||||
MaintainCount mc2(nrStepsCopyingTo);
|
MaintainCount mc2(nrStepsCopyingTo);
|
||||||
printMsg(lvlDebug, format("sending closure of ‘%1%’ to ‘%2%’") % step->drvPath % machine->sshName);
|
printMsg(lvlDebug, format("sending closure of ‘%1%’ to ‘%2%’") % step->drvPath % machine->sshName);
|
||||||
|
|
|
@ -231,7 +231,7 @@ struct Machine
|
||||||
|
|
||||||
/* Mutex to prevent multiple threads from sending data to the
|
/* Mutex to prevent multiple threads from sending data to the
|
||||||
same machine (which would be inefficient). */
|
same machine (which would be inefficient). */
|
||||||
std::mutex sendLock;
|
std::timed_mutex sendLock;
|
||||||
};
|
};
|
||||||
|
|
||||||
State::ptr state;
|
State::ptr state;
|
||||||
|
|
Loading…
Reference in a new issue