7512: Reap proc macro server instances r=lnicola a=lnicola

Fixes #7510, but not the root cause.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
This commit is contained in:
bors[bot] 2021-02-01 19:25:00 +00:00 committed by GitHub
commit 379b677559
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 8 deletions

1
Cargo.lock generated
View File

@ -1158,6 +1158,7 @@ dependencies = [
"log",
"serde",
"serde_json",
"stdx",
"tt",
]

View File

@ -18,3 +18,4 @@ jod-thread = "0.1.1"
tt = { path = "../tt", version = "0.0.0" }
base_db = { path = "../base_db", version = "0.0.0" }
stdx = { path = "../stdx", version = "0.0.0" }

View File

@ -10,6 +10,7 @@ use std::{
};
use crossbeam_channel::{bounded, Receiver, Sender};
use stdx::JodChild;
use crate::{
msg::{ErrorCode, Message, Request, Response, ResponseError},
@ -116,13 +117,7 @@ struct Task {
}
struct Process {
child: Child,
}
impl Drop for Process {
fn drop(&mut self) {
let _ = self.child.kill();
}
child: JodChild,
}
impl Process {
@ -131,7 +126,7 @@ impl Process {
args: impl IntoIterator<Item = impl AsRef<OsStr>>,
) -> io::Result<Process> {
let args: Vec<OsString> = args.into_iter().map(|s| s.as_ref().into()).collect();
let child = mk_child(&path, &args)?;
let child = JodChild(mk_child(&path, &args)?);
Ok(Process { child })
}