give capnp ownership of process output fd

this fixes an intermittent issue (race condition?) where
the IoContext attempts to poll an already-closed fd
pull/5/head
Oliver Giles 7 years ago
parent 668ada74d1
commit 3068180f8e

@ -518,7 +518,6 @@ void Laminar::reapAdvance() {
std::shared_ptr<Run> run = *it;
bool completed = true;
activeJobs.get<0>().modify(it, [&](std::shared_ptr<Run> run){
close(run->fd);
run->reaped(ret);
completed = stepRun(run);
});

@ -389,7 +389,7 @@ void Server::stop() {
}
void Server::addDescriptor(int fd, std::function<void(char*,size_t)> cb) {
auto event = this->ioContext.lowLevelProvider->wrapInputFd(fd);
auto event = this->ioContext.lowLevelProvider->wrapInputFd(fd, kj::LowLevelAsyncIoProvider::TAKE_OWNERSHIP);
tasks.add(handleFdRead(event, cb).attach(std::move(event)));
}

Loading…
Cancel
Save