feat: release Dever 0.1.5 with direct workers and long transactions

This commit is contained in:
Codex committed 2026-10-11 11:17:33 +00:00
1 parent 89629c2197
commit a900d7e8db
153 files changed
+3676 -3708

No files matched your search

+15 -4
View File
@@ -25,7 +25,8 @@ fn main() {
fn run() -> Result<i32, Box<dyn std::error::Error>> {
let mut arguments = std::env::args().skip(1);
match arguments.next().as_deref() {
let mode = arguments.next();
match mode.as_deref() {
Some("echo") => {
for argument in arguments {
std::io::stdout().write_all(argument.as_bytes())?;
@@ -63,7 +64,7 @@ fn run() -> Result<i32, Box<dyn std::error::Error>> {
stdout.join().map_err(|_| "stdout thread panicked")??;
stderr.join().map_err(|_| "stderr thread panicked")??;
}
Some("wait") | Some("tree") => {
Some("wait") | Some("tree") | Some("tree-exit") => {
let directory = arguments.next().ok_or("missing marker directory")?;
let directory = Path::new(&directory);
let mut starts = std::fs::OpenOptions::new()
@@ -71,13 +72,23 @@ fn run() -> Result<i32, Box<dyn std::error::Error>> {
.append(true)
.open(directory.join("starts"))?;
starts.write_all(b"started\n")?;
// Every lifecycle case gets a real descendant. PID namespace exit
// must stop its heartbeat before the runtime returns cancellation.
let mut child = std::process::Command::new(std::env::current_exe()?)
.arg("heartbeat")
.arg(directory)
.spawn()?;
std::fs::write(directory.join("ready"), b"ready")?;
if mode.as_deref() == Some("tree-exit") {
let deadline = std::time::Instant::now() + Duration::from_secs(2);
while !directory.join("heartbeat").exists() {
if std::time::Instant::now() >= deadline {
let _ = child.kill();
let _ = child.wait();
return Err("descendant did not start".into());
}
std::thread::sleep(Duration::from_millis(5));
}
return Ok(0);
}
let status = child.wait()?;
return Ok(status.code().unwrap_or(92));
}