Update to latest Lix main

This commit is contained in:
Pierre Bourdon
2024-06-24 20:25:35 +02:00
parent cbe527a3ee
commit e9d0a3a754
5 changed files with 19 additions and 19 deletions
+5 -5
View File
@@ -349,14 +349,14 @@ int main(int argc, char * * argv)
/* Start a handler thread per worker process. */
auto handler = [&]()
{
pid_t pid = -1;
Pid pid;
try {
AutoCloseFD from, to;
while (true) {
/* Start a new worker process if necessary. */
if (pid == -1) {
if (!pid) {
Pipe toPipe, fromPipe;
toPipe.create();
fromPipe.create();
@@ -383,13 +383,13 @@ int main(int argc, char * * argv)
});
from = std::move(fromPipe.readSide);
to = std::move(toPipe.writeSide);
debug("created worker process %d", pid);
debug("created worker process %d", pid.get());
}
/* Check whether the existing worker process is still there. */
auto s = readLine(from.get());
if (s == "restart") {
pid = -1;
pid.wait();
continue;
} else if (s != "next") {
auto json = nlohmann::json::parse(s);
@@ -455,7 +455,7 @@ int main(int argc, char * * argv)
}
}
} catch (...) {
check_pid_status_nonblocking(pid);
check_pid_status_nonblocking(pid.release());
auto state(state_.lock());
state->exc = std::current_exception();
wakeup.notify_all();
+4 -4
View File
@@ -191,7 +191,7 @@ struct Evaluator
txn.commit();
}
assert(jobset.pid == -1);
assert(jobset.pid);
jobset.pid = startProcess([&]() {
Strings args = { "hydra-eval-jobset", jobset.name.project, jobset.name.jobset };
@@ -206,7 +206,7 @@ struct Evaluator
bool shouldEvaluate(Jobset & jobset)
{
if (jobset.pid != -1) {
if (jobset.pid) {
// Already running.
debug("shouldEvaluate %s? no: already running",
jobset.name.display());
@@ -330,7 +330,7 @@ struct Evaluator
if (state->runningEvals < maxEvals) {
for (auto & i : state->jobsets)
if (i.second.pid == -1 &&
if (!i.second.pid &&
i.second.checkInterval > 0)
sleepTime = std::min(sleepTime, std::chrono::seconds(
std::max((time_t) 1, i.second.lastCheckedTime - now + i.second.checkInterval)));
@@ -407,7 +407,7 @@ struct Evaluator
for (auto & i : state->jobsets) {
auto & jobset(i.second);
if (jobset.pid == pid) {
if (jobset.pid.get() == pid) {
printInfo("evaluation of jobset %s %s",
jobset.name.display(), statusToString(status));
+1 -1
View File
@@ -531,7 +531,7 @@ void State::buildRemote(ref<Store> destStore,
{
auto activeStepState(activeStep->state_.lock());
if (activeStepState->cancelled) throw Error("step cancelled");
activeStepState->pid = child.sshPid;
activeStepState->pid = child.sshPid.get();
}
Finally clearPid([&]() {