Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] moon run doesn't wait for process to exit on Ctrl-C #1678

Open
JeremyMoeglich opened this issue Oct 9, 2024 · 31 comments
Open

[bug] moon run doesn't wait for process to exit on Ctrl-C #1678

JeremyMoeglich opened this issue Oct 9, 2024 · 31 comments
Assignees
Labels
bug Something isn't working

Comments

@JeremyMoeglich
Copy link

JeremyMoeglich commented Oct 9, 2024

Describe the bug

I have a persistent task which runs a program, this program has some exit logic that runs after
tokio::signal::ctrl_c().await.unwrap(); or in general after ctrl-c
When I run it directly this logic runs, if I run via moon run it sometimes executes a little, but is always stopped before finishing

Steps to reproduce

fn main() {
    ctrlc::set_handler(move || {
        std::thread::sleep(std::time::Duration::from_secs(1));

        println!("This never gets printed");
        std::process::exit(0);
    })
    .expect("Error setting Ctrl-C handler");


    loop {
        std::thread::sleep(std::time::Duration::from_secs(1));
    }
}
testtask:
    command: "cargo run"
    description: "Test task"
    options:
      persistent: true

Exits immediately

Expected behavior

Should wait before exiting like it does when running directly

Environment

System:
OS: Windows 11 10.0.22631
CPU: (20) x64 13th Gen Intel(R) Core(TM) i5-13500T
Memory: 5.18 GB / 31.70 GB
Binaries:
Node: 20.15.1 - ~\AppData\Local\fnm_multishells\120760_1728461189958\node.EXE
npm: 10.7.0 - ~\AppData\Local\fnm_multishells\120760_1728461189958\npm.CMD
bun: 1.1.29 - ~.proto\shims\bun.EXE
Managers:
Cargo: 1.80.1 - ~.cargo\bin\cargo.EXE
pip3: 24.1.2 - ~.proto\shims\pip3.EXE
Utilities:
Git: 2.44.0. - C:\Program Files\Git\cmd\git.EXE
Clang: 19.1.0 - C:\Program Files\LLVM\bin\clang.EXE
Curl: 8.7.1 - C:\Windows\system32\curl.EXE
Virtualization:
Docker: 27.2.0 - C:\Program Files\Docker\Docker\resources\bin\docker.EXE
Docker Compose: 2.28.1 - C:\Program Files\Docker\Docker\resources\bin\docker-compose.EXE
IDEs:
VSCode: 0.41.3 - c:\Users\moeglich\AppData\Local\Programs\cursor\resources\app\bin\code.CMD
Languages:
Java: 21.0.4 - C:\Program Files\Eclipse Adoptium\jdk-21.0.4.7-hotspot\bin\javac.EXE
Python: 3.12.5 - C:\Users\moeglich.proto\shims\python.EXE
Python3: 3.12.5 - C:\Users\moeglich.proto\shims\python3.EXE
Rust: 1.80.1 - C:\Users\moeglich.cargo\bin\rustc.EXE
Databases:
PostgreSQL: 16.3 - C:\Program Files\PostgreSQL\16\bin\postgres.EXE
Browsers:
Edge: Chromium (128.0.2739.79)
Internet Explorer: 11.0.22621.3527

Additional context

I'll test this on linux later, right now I've only tested windows

@JeremyMoeglich JeremyMoeglich added the bug Something isn't working label Oct 9, 2024
@JeremyMoeglich
Copy link
Author

Also applies to linux

@milesj
Copy link
Collaborator

milesj commented Oct 11, 2024

We abort threads in tokio: https://docs.rs/tokio/latest/tokio/task/index.html#cancellation

I'm pretty sure this just kills the thread and doesn't actually pass SIGINT through.

@JeremyMoeglich
Copy link
Author

JeremyMoeglich commented Oct 11, 2024

I assume it would be possible to attach a different behaviour on drop here

let mut command = TokioCommand::new(&command_line.command[0]);
command.args(&command_line.command[1..]);
command.envs(&self.env);
command.kill_on_drop(true);

I'll look into this a little more. The main issue may be that drop is sync and you shouldn't block the runtime

@JeremyMoeglich
Copy link
Author

JeremyMoeglich commented Oct 11, 2024

tokio-rs/tokio#2504 talks about this issue. Also proposes some solutions, though in this case the correct solution may require awaiting exit rather than assuming drop to do that for you

@JeremyMoeglich
Copy link
Author

Trying to fix this myself.

The behaviour I am going for is it waiting for all processes to exit explicitly via SIGTERM. While keeping the SIGKILL on drop in case of panic unwind or any other unexpected drop.

This will lead to it being stuck if the process doesn't respect SIGTERM. Adding a timeout of a random duration doesn't feel right either though. I'll worry about that later

@JeremyMoeglich
Copy link
Author

This will take a while, there are no crates that do this in a way that would work on windows and unix.
Even cargo run does not handle this properly since it only redirects Ctrl-C on windows not the other handlers.

I think I'll move my current logic into external crates since it's too generic to fit here

@milesj
Copy link
Collaborator

milesj commented Oct 13, 2024

Yeah, I've noticed the rust ecosystem doesn't have really good support for cross-platform signals, or ways to achieve this easily.

@milesj
Copy link
Collaborator

milesj commented Jan 6, 2025

I reworked this a bit in v1.31 so it should wait now for them to be cancelled.

@JeremyMoeglich
Copy link
Author

JeremyMoeglich commented Jan 11, 2025

Testing on v1.31.1 (linux) it still fails for all signals

Signal Test Name Result
SIGABRT Direct ✅ Correct Signal: SIGABRT
SIGABRT Bash ✅ Correct Signal: SIGABRT
SIGABRT Cargo ✅ Correct Signal: SIGABRT
SIGABRT Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGABRT Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGALRM Direct ✅ Correct Signal: SIGALRM
SIGALRM Bash ✅ Correct Signal: SIGALRM
SIGALRM Cargo ✅ Correct Signal: SIGALRM
SIGALRM Moon Persistent ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGALRM Moon Interactive ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGBUS Direct ✅ Correct Signal: SIGBUS
SIGBUS Bash ✅ Correct Signal: SIGBUS
SIGBUS Cargo ✅ Correct Signal: SIGBUS
SIGBUS Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGBUS Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n▪▪▪▪ root:interactive_signal (running for 60s)\n\nStderr:
SIGCHLD Direct ✅ Correct Signal: SIGCHLD
SIGCHLD Bash ✅ Correct Signal: SIGCHLD
SIGCHLD Cargo ✅ Correct Signal: SIGCHLD
SIGCHLD Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGCHLD Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n▪▪▪▪ root:interactive_signal (running for 60s)\n\nStderr:
SIGCONT Direct ✅ Correct Signal: SIGCONT
SIGCONT Bash ✅ Correct Signal: SIGCONT
SIGCONT Cargo ✅ Correct Signal: SIGCONT
SIGCONT Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGCONT Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n▪▪▪▪ root:interactive_signal (running for 60s)\n\nStderr:
SIGHUP Direct ✅ Correct Signal: SIGHUP
SIGHUP Bash ✅ Correct Signal: SIGHUP
SIGHUP Cargo ✅ Correct Signal: SIGHUP
SIGHUP Moon Persistent ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGHUP Moon Interactive ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGINT Direct ✅ Correct Signal: SIGINT
SIGINT Bash ✅ Correct Signal: SIGINT
SIGINT Cargo ✅ Correct Signal: SIGINT
SIGINT Moon Persistent ⚠️ Wrong output, parent likely killed child. Expected: SIGINT, Actual Output: ▪▪▪▪ root:persistent_signal\n\nTasks: 1 skipped\n Time: 59s 923ms ❯❯❯❯ to the moon\n\n
SIGINT Moon Interactive ⚠️ Wrong output, parent likely killed child. Expected: SIGINT, Actual Output: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nTasks: 1 skipped\n Time: 59s 784ms ❯❯❯❯ to the moon\n\n
SIGPIPE Direct ✅ Correct Signal: SIGPIPE
SIGPIPE Bash ✅ Correct Signal: SIGPIPE
SIGPIPE Cargo ✅ Correct Signal: SIGPIPE
SIGPIPE Moon Persistent ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGPIPE Moon Interactive ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGPROF Direct ✅ Correct Signal: SIGPROF
SIGPROF Bash ✅ Correct Signal: SIGPROF
SIGPROF Cargo ✅ Correct Signal: SIGPROF
SIGPROF Moon Persistent ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGPROF Moon Interactive ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGQUIT Direct ✅ Correct Signal: SIGQUIT
SIGQUIT Bash ✅ Correct Signal: SIGQUIT
SIGQUIT Cargo ✅ Correct Signal: SIGQUIT
SIGQUIT Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGQUIT Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGSYS Direct ✅ Correct Signal: SIGSYS
SIGSYS Bash ✅ Correct Signal: SIGSYS
SIGSYS Cargo ✅ Correct Signal: SIGSYS
SIGSYS Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGSYS Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGTERM Direct ✅ Correct Signal: SIGTERM
SIGTERM Bash ✅ Correct Signal: SIGTERM
SIGTERM Cargo ✅ Correct Signal: SIGTERM
SIGTERM Moon Persistent ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGTERM Moon Interactive ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGTRAP Direct ✅ Correct Signal: SIGTRAP
SIGTRAP Bash ✅ Correct Signal: SIGTRAP
SIGTRAP Cargo ✅ Correct Signal: SIGTRAP
SIGTRAP Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGTRAP Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGTSTP Direct ✅ Correct Signal: SIGTSTP
SIGTSTP Bash ✅ Correct Signal: SIGTSTP
SIGTSTP Cargo ✅ Correct Signal: SIGTSTP
SIGTSTP Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGTSTP Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGTTIN Direct ✅ Correct Signal: SIGTTIN
SIGTTIN Bash ✅ Correct Signal: SIGTTIN
SIGTTIN Cargo ✅ Correct Signal: SIGTTIN
SIGTTIN Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGTTIN Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGTTOU Direct ✅ Correct Signal: SIGTTOU
SIGTTOU Bash ✅ Correct Signal: SIGTTOU
SIGTTOU Cargo ✅ Correct Signal: SIGTTOU
SIGTTOU Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGTTOU Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGURG Direct ✅ Correct Signal: SIGURG
SIGURG Bash ✅ Correct Signal: SIGURG
SIGURG Cargo ✅ Correct Signal: SIGURG
SIGURG Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGURG Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n▪▪▪▪ root:interactive_signal (running for 60s)\n\nStderr:
SIGUSR1 Direct ✅ Correct Signal: SIGUSR1
SIGUSR1 Bash ✅ Correct Signal: SIGUSR1
SIGUSR1 Cargo ✅ Correct Signal: SIGUSR1
SIGUSR1 Moon Persistent ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGUSR1 Moon Interactive ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGUSR2 Direct ✅ Correct Signal: SIGUSR2
SIGUSR2 Bash ✅ Correct Signal: SIGUSR2
SIGUSR2 Cargo ✅ Correct Signal: SIGUSR2
SIGUSR2 Moon Persistent ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGUSR2 Moon Interactive ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGVTALRM Direct ✅ Correct Signal: SIGVTALRM
SIGVTALRM Bash ✅ Correct Signal: SIGVTALRM
SIGVTALRM Cargo ✅ Correct Signal: SIGVTALRM
SIGVTALRM Moon Persistent ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGVTALRM Moon Interactive ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGWINCH Direct ✅ Correct Signal: SIGWINCH
SIGWINCH Bash ✅ Correct Signal: SIGWINCH
SIGWINCH Cargo ✅ Correct Signal: SIGWINCH
SIGWINCH Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGWINCH Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n▪▪▪▪ root:interactive_signal (running for 60s)\n\nStderr:
SIGXCPU Direct ✅ Correct Signal: SIGXCPU
SIGXCPU Bash ✅ Correct Signal: SIGXCPU
SIGXCPU Cargo ✅ Correct Signal: SIGXCPU
SIGXCPU Moon Persistent ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGXCPU Moon Interactive ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGXFSZ Direct ⚠️ Wrong output, parent likely killed child. Expected: SIGXFSZ, Actual Output:
SIGXFSZ Bash ⚠️ Wrong output, parent likely killed child. Expected: SIGXFSZ, Actual Output:
SIGXFSZ Cargo ✅ Correct Signal: SIGXFSZ
SIGXFSZ Moon Persistent ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGXFSZ Moon Interactive ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGIO Direct ✅ Correct Signal: SIGIO
SIGIO Bash ✅ Correct Signal: SIGIO
SIGIO Cargo ✅ Correct Signal: SIGIO
SIGIO Moon Persistent ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:persistent_signal\n\nStderr:
SIGIO Moon Interactive ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:

I used these options

tasks:
persistent_signal:
command: "target/release/signal"
options:
cache: false
persistent: true

interactive_signal:
command: "target/release/signal"
options:
cache: false
interactive: true

I think I'll just use signal_hook despite it only somewhat handling windows, for linux I am aiming to get all signals working for windows I'll settle with SIGINT

@JeremyMoeglich
Copy link
Author

I'll send the reproduction in a bit

@JeremyMoeglich
Copy link
Author

JeremyMoeglich commented Jan 11, 2025

https://github.com/JeremyMoeglich/moon_signal_reproduction
Run cargo build first then run cargo run --release --bin send_signal

@milesj
Copy link
Collaborator

milesj commented Jan 11, 2025

I still don't pass the signals down, so that still won't work. But it should wait for tasks to finishing shutting down.

@JeremyMoeglich
Copy link
Author

JeremyMoeglich commented Jan 11, 2025

That seems to not work, at least not for me

small reproduction

use std::time::Duration;
use ctrlc::set_handler;

fn main() {
    set_handler(|| {
        println!("Signal received, waiting 1 second");
        std::thread::sleep(Duration::from_secs(1));
        println!("done");
        std::process::exit(0);
    }).unwrap();

    std::thread::sleep(Duration::MAX);
}
$ cargo run --bin slow_drop
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.02s
     Running `target/debug/slow_drop`
^CSignal received, waiting 1 second
done
$ moon run root:slow_drop        
▪▪▪▪ root:slow_drop
^CSignal received, waiting 1 second

Tasks: 1 skipped
 Time: 7s 479ms ❯❯❯❯ to the moon

@JeremyMoeglich
Copy link
Author

JeremyMoeglich commented Jan 11, 2025

I suspect this is the main piece of code that handles this

            // Since these tasks are persistent and never complete,
            // we need to continually check if they've been aborted or
            // cancelled, otherwise we will end up with zombie processes
            loop {
                sleep(Duration::from_millis(150)).await;

                // No tasks running, so don't hang forever
                if job_context.result_sender.is_closed() {
                    break;
                }

                if job_context.is_aborted_or_cancelled() {
                    debug!("Shutting down {} persistent jobs", job_handles.len());

                    job_handles.shutdown().await;
                    break;
                }
            }

.shutdown() simply aborts all futures in job_handles. There is no such thing as a way to gracefully shutdown a future.
I suspect the only option is to pass down events via something like tokio::sync::broadcast or by having a method that is passed all the way down to the child handling that sends SIGTERM or SIGINT depending on what you prefer

@milesj
Copy link
Collaborator

milesj commented Jan 11, 2025

Yah that's the end goal. I need to find a way to share the Child instance of hte process around, so that we can actually pass signals to it.

There's this: https://crates.io/crates/shared_child but it's Windows support seems non-existent.

@milesj
Copy link
Collaborator

milesj commented Jan 12, 2025

Looking into this here #1790

@milesj
Copy link
Collaborator

milesj commented Jan 14, 2025

New implementation seems to be working much better.

Screenshot 2025-01-13 at 5 20 53 PM

@JeremyMoeglich
Copy link
Author

Testing the branch you've been working on it still seems to be killing the child process rather than waiting

| SIGINT | Moon Persistent | ⚠️ Wrong output, parent likely killed child. Expected: SIGINT, Actual Output: Waiting for signal...\n▪▪▪▪ root:persistent_signal\n\nTasks: 1 skipped\n Time: 59s 696ms ❯❯❯❯ to the moon\n\n |

@milesj
Copy link
Collaborator

milesj commented Jan 14, 2025

That's odd since we explicitly wait so that process reaping can function correctly: https://github.com/moonrepo/moon/pull/1790/files#diff-7d3e0aaa6ba5077700059589b360158272c16327362b17ab251740ae9b9dfd27R76

I wonder if something else is killing it outside of this. I'll dig further.

@JeremyMoeglich
Copy link
Author

Looking at the code it does what I would do too. My testing code literally does the same thing to send the signals.
I can run it with verbose logs later

@JeremyMoeglich
Copy link
Author

JeremyMoeglich commented Jan 14, 2025

I suspect I might have used the wrong branch, I can't really test it since my reproduction only works on linux and I am on windows right now. But I can at least test windows then

@JeremyMoeglich
Copy link
Author

JeremyMoeglich commented Jan 14, 2025

Ok there is some interesting behavior on windows, it properly forwards the signal but moon does end early

Before it would just exit without a status like this

PS C:\Users\moeglich\dev\moon_signal_reproduction> moon run root:wait
▪▪▪▪ root:wait
PS C:\Users\moeglich\dev\moon_signal_reproduction>

Now it does print a status and doesn't kill, but does end early

./moon.exe run root:wait
▪▪▪▪ root:wait

Tasks: 1 skipped
Time: 2s 606ms ❯❯❯❯ to the moon

PS C:\Users\moeglich\dev\moon_signal_reproduction> SIGINT

That means the SIGINT appears after moon has already exited.

Code:

use std::io::Error;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::time::Duration;
use tokio;

#[tokio::main]
async fn main() -> Result<(), Error> {
    let running = Arc::new(AtomicBool::new(true));
    let r = running.clone();

    ctrlc::set_handler(move || {
        r.store(false, Ordering::SeqCst);
    })
    .expect("Error setting Ctrl-C handler");

    while running.load(Ordering::SeqCst) {
        tokio::time::sleep(Duration::from_secs(5)).await;
    }

    print!("SIGINT");
    Ok(())
}

@JeremyMoeglich
Copy link
Author

I have retested the version and I was indeed on the wrong branch, sorry for that.
Here is the actual result

The two signals that matter most SIGINT and SIGTERM are forwarded correctly. You could use https://docs.rs/signal-hook-tokio/latest/signal_hook_tokio/ to handle the others on linux

Signal Test Name Result
SIGABRT Direct ✅ Correct Signal: SIGABRT
SIGABRT Bash ✅ Correct Signal: SIGABRT
SIGABRT Cargo ✅ Correct Signal: Waiting for signal...\nSIGABRTDropping DropStruct\n
SIGABRT Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:persistent_signal\nWaiting for signal...\n\nStderr:
SIGABRT Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:interactive_signal\nWaiting for signal...\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGALRM Direct ✅ Correct Signal: SIGALRM
SIGALRM Bash ✅ Correct Signal: SIGALRM
SIGALRM Cargo ✅ Correct Signal: Waiting for signal...\nSIGALRMDropping DropStruct\n
SIGALRM Moon Persistent ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:persistent_signal\nWaiting for signal...\n\nStderr:
SIGALRM Moon Interactive ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:interactive_signal\nWaiting for signal...\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGBUS Direct ✅ Correct Signal: SIGBUS
SIGBUS Bash ✅ Correct Signal: SIGBUS
SIGBUS Cargo ✅ Correct Signal: Waiting for signal...\nSIGBUSDropping DropStruct\n
SIGBUS Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:persistent_signal\nWaiting for signal...\n\nStderr:
SIGBUS Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:interactive_signal\nWaiting for signal...\n▪▪▪▪ root:interactive_signal (running for 30s)\n▪▪▪▪ root:interactive_signal (running for 60s)\n\nStderr:
SIGCHLD Direct ✅ Correct Signal: SIGCHLD
SIGCHLD Bash ✅ Correct Signal: SIGCHLD
SIGCHLD Cargo ✅ Correct Signal: Waiting for signal...\nSIGCHLDDropping DropStruct\n
SIGCHLD Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: Waiting for signal...\n▪▪▪▪ root:persistent_signal\n\nStderr:
SIGCHLD Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:interactive_signal\nWaiting for signal...\n▪▪▪▪ root:interactive_signal (running for 30s)\n▪▪▪▪ root:interactive_signal (running for 60s)\n\nStderr:
SIGCONT Direct ✅ Correct Signal: SIGCONT
SIGCONT Bash ✅ Correct Signal: SIGCONT
SIGCONT Cargo ✅ Correct Signal: Waiting for signal...\nSIGCONTDropping DropStruct\n
SIGCONT Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:persistent_signal\nWaiting for signal...\n\nStderr:
SIGCONT Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: Waiting for signal...\n▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n▪▪▪▪ root:interactive_signal (running for 60s)\n\nStderr:
SIGHUP Direct ✅ Correct Signal: SIGHUP
SIGHUP Bash ✅ Correct Signal: SIGHUP
SIGHUP Cargo ✅ Correct Signal: Waiting for signal...\nSIGHUPDropping DropStruct\n
SIGHUP Moon Persistent ⚠️ Error Status. Code: None\nStdout: Waiting for signal...\n▪▪▪▪ root:persistent_signal\n\nStderr:
SIGHUP Moon Interactive ⚠️ Error Status. Code: None\nStdout: Waiting for signal...\n▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGINT Direct ✅ Correct Signal: SIGINT
SIGINT Bash ✅ Correct Signal: SIGINT
SIGINT Cargo ✅ Correct Signal: Waiting for signal...\nSIGINTDropping DropStruct\n
SIGINT Moon Persistent ✅ Correct Signal: ▪▪▪▪ root:persistent_signal\nWaiting for signal...\nSIGINTDropping DropStruct\n\nTasks: 1 skipped\n Time: 1m 5s 690ms ❯❯❯❯ to the moon\n\n
SIGINT Moon Interactive ✅ Correct Signal: ▪▪▪▪ root:interactive_signal\nWaiting for signal...\n▪▪▪▪ root:interactive_signal (running for 30s)\nSIGINTDropping DropStruct\n\nTasks: 1 skipped\n Time: 1m 5s 674ms ❯❯❯❯ to the moon\n\n
SIGPIPE Direct ✅ Correct Signal: SIGPIPE
SIGPIPE Bash ✅ Correct Signal: SIGPIPE
SIGPIPE Cargo ✅ Correct Signal: Waiting for signal...\nSIGPIPEDropping DropStruct\n
SIGPIPE Moon Persistent ⚠️ Error Status. Code: None\nStdout: Waiting for signal...\n▪▪▪▪ root:persistent_signal\n\nStderr:
SIGPIPE Moon Interactive ⚠️ Error Status. Code: None\nStdout: Waiting for signal...\n▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGPROF Direct ✅ Correct Signal: SIGPROF
SIGPROF Bash ✅ Correct Signal: SIGPROF
SIGPROF Cargo ✅ Correct Signal: Waiting for signal...\nSIGPROFDropping DropStruct\n
SIGPROF Moon Persistent ⚠️ Error Status. Code: None\nStdout: Waiting for signal...\n▪▪▪▪ root:persistent_signal\n\nStderr:
SIGPROF Moon Interactive ⚠️ Error Status. Code: None\nStdout: Waiting for signal...\n▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGQUIT Direct ✅ Correct Signal: SIGQUIT
SIGQUIT Bash ✅ Correct Signal: SIGQUIT
SIGQUIT Cargo ✅ Correct Signal: Waiting for signal...\nSIGQUITDropping DropStruct\n
SIGQUIT Moon Persistent ✅ Correct Signal: Waiting for signal...\n▪▪▪▪ root:persistent_signal\nSIGQUITDropping DropStruct\n
SIGQUIT Moon Interactive ✅ Correct Signal: Waiting for signal...\n▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\nSIGQUITDropping DropStruct\n
SIGSYS Direct ✅ Correct Signal: SIGSYS
SIGSYS Bash ✅ Correct Signal: SIGSYS
SIGSYS Cargo ✅ Correct Signal: Waiting for signal...\nSIGSYSDropping DropStruct\n
SIGSYS Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:persistent_signal\nWaiting for signal...\n\nStderr:
SIGSYS Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: Waiting for signal...\n▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGTERM Direct ✅ Correct Signal: SIGTERM
SIGTERM Bash ✅ Correct Signal: SIGTERM
SIGTERM Cargo ✅ Correct Signal: Waiting for signal...\nSIGTERMDropping DropStruct\n
SIGTERM Moon Persistent ✅ Correct Signal: Waiting for signal...\n▪▪▪▪ root:persistent_signal\nSIGTERMDropping DropStruct\n\nTasks: 1 skipped\n Time: 1m 5s 699ms ❯❯❯❯ to the moon\n\n
SIGTERM Moon Interactive ✅ Correct Signal: Waiting for signal...\n▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\nSIGTERMDropping DropStruct\n\nTasks: 1 skipped\n Time: 1m 5s 684ms ❯❯❯❯ to the moon\n\n
SIGTRAP Direct ✅ Correct Signal: SIGTRAP
SIGTRAP Bash ✅ Correct Signal: SIGTRAP
SIGTRAP Cargo ✅ Correct Signal: Waiting for signal...\nSIGTRAPDropping DropStruct\n
SIGTRAP Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: Waiting for signal...\n▪▪▪▪ root:persistent_signal\n\nStderr:
SIGTRAP Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:interactive_signal\nWaiting for signal...\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGTSTP Direct ✅ Correct Signal: SIGTSTP
SIGTSTP Bash ✅ Correct Signal: SIGTSTP
SIGTSTP Cargo ✅ Correct Signal: Waiting for signal...\nSIGTSTPDropping DropStruct\n
SIGTSTP Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: Waiting for signal...\n▪▪▪▪ root:persistent_signal\n\nStderr:
SIGTSTP Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: Waiting for signal...\n▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGTTIN Direct ✅ Correct Signal: SIGTTIN
SIGTTIN Bash ✅ Correct Signal: SIGTTIN
SIGTTIN Cargo ✅ Correct Signal: Waiting for signal...\nSIGTTINDropping DropStruct\n
SIGTTIN Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: Waiting for signal...\n▪▪▪▪ root:persistent_signal\n\nStderr:
SIGTTIN Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:interactive_signal\nWaiting for signal...\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGTTOU Direct ✅ Correct Signal: SIGTTOU
SIGTTOU Bash ✅ Correct Signal: SIGTTOU
SIGTTOU Cargo ✅ Correct Signal: Waiting for signal...\nSIGTTOUDropping DropStruct\n
SIGTTOU Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:persistent_signal\nWaiting for signal...\n\nStderr:
SIGTTOU Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: Waiting for signal...\n▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGURG Direct ✅ Correct Signal: SIGURG
SIGURG Bash ✅ Correct Signal: SIGURG
SIGURG Cargo ✅ Correct Signal: Waiting for signal...\nSIGURGDropping DropStruct\n
SIGURG Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:persistent_signal\nWaiting for signal...\n\nStderr:
SIGURG Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: Waiting for signal...\n▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n▪▪▪▪ root:interactive_signal (running for 60s)\n\nStderr:
SIGUSR1 Direct ✅ Correct Signal: SIGUSR1
SIGUSR1 Bash ✅ Correct Signal: SIGUSR1
SIGUSR1 Cargo ✅ Correct Signal: Waiting for signal...\nSIGUSR1Dropping DropStruct\n
SIGUSR1 Moon Persistent ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:persistent_signal\nWaiting for signal...\n\nStderr:
SIGUSR1 Moon Interactive ⚠️ Error Status. Code: None\nStdout: Waiting for signal...\n▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGUSR2 Direct ✅ Correct Signal: SIGUSR2
SIGUSR2 Bash ✅ Correct Signal: SIGUSR2
SIGUSR2 Cargo ✅ Correct Signal: Waiting for signal...\nSIGUSR2Dropping DropStruct\n
SIGUSR2 Moon Persistent ⚠️ Error Status. Code: None\nStdout: Waiting for signal...\n▪▪▪▪ root:persistent_signal\n\nStderr:
SIGUSR2 Moon Interactive ⚠️ Error Status. Code: None\nStdout: Waiting for signal...\n▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGVTALRM Direct ✅ Correct Signal: SIGVTALRM
SIGVTALRM Bash ✅ Correct Signal: SIGVTALRM
SIGVTALRM Cargo ✅ Correct Signal: Waiting for signal...\nSIGVTALRMDropping DropStruct\n
SIGVTALRM Moon Persistent ⚠️ Error Status. Code: None\nStdout: Waiting for signal...\n▪▪▪▪ root:persistent_signal\n\nStderr:
SIGVTALRM Moon Interactive ⚠️ Error Status. Code: None\nStdout: Waiting for signal...\n▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGWINCH Direct ✅ Correct Signal: SIGWINCH
SIGWINCH Bash ✅ Correct Signal: SIGWINCH
SIGWINCH Cargo ✅ Correct Signal: Waiting for signal...\nSIGWINCHDropping DropStruct\n
SIGWINCH Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: Waiting for signal...\n▪▪▪▪ root:persistent_signal\n\nStderr:
SIGWINCH Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: Waiting for signal...\n▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n▪▪▪▪ root:interactive_signal (running for 60s)\n\nStderr:
SIGXCPU Direct ✅ Correct Signal: SIGXCPU
SIGXCPU Bash ✅ Correct Signal: SIGXCPU
SIGXCPU Cargo ✅ Correct Signal: Waiting for signal...\nSIGXCPUDropping DropStruct\n
SIGXCPU Moon Persistent ⚠️ Error Status. Code: None\nStdout: Waiting for signal...\n▪▪▪▪ root:persistent_signal\n\nStderr:
SIGXCPU Moon Interactive ⏰ Timeout, signal likely ignored.\nStdout: Waiting for signal...\n▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGXFSZ Direct ✅ Correct Signal: SIGXFSZ
SIGXFSZ Bash ✅ Correct Signal: SIGXFSZ
SIGXFSZ Cargo ✅ Correct Signal: Waiting for signal...\nSIGXFSZDropping DropStruct\n
SIGXFSZ Moon Persistent ⏰ Timeout, signal likely ignored.\nStdout: ▪▪▪▪ root:persistent_signal\nWaiting for signal...\n\nStderr:
SIGXFSZ Moon Interactive ⚠️ Error Status. Code: None\nStdout: Waiting for signal...\n▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:
SIGIO Direct ✅ Correct Signal: SIGIO
SIGIO Bash ✅ Correct Signal: SIGIO
SIGIO Cargo ✅ Correct Signal: Waiting for signal...\nSIGIODropping DropStruct\n
SIGIO Moon Persistent ⚠️ Error Status. Code: None\nStdout: ▪▪▪▪ root:persistent_signal\nWaiting for signal...\n\nStderr:
SIGIO Moon Interactive ⚠️ Error Status. Code: None\nStdout: Waiting for signal...\n▪▪▪▪ root:interactive_signal\n▪▪▪▪ root:interactive_signal (running for 30s)\n\nStderr:

@milesj
Copy link
Collaborator

milesj commented Jan 14, 2025

I think I found part of the problem. I've been using this https://docs.rs/tokio/latest/tokio/task/struct.JoinSet.html#method.shutdown

Which force aborts the threads, so rewriting parts of that code.

@milesj
Copy link
Collaborator

milesj commented Jan 14, 2025

Looks like process groups are stable, at least on Unix. Going to give that a try. Should make this much easier.

@milesj
Copy link
Collaborator

milesj commented Jan 14, 2025

Just stumbled upon this crate https://crates.io/crates/process-wrap

Should solve most of these problems.

@milesj
Copy link
Collaborator

milesj commented Jan 15, 2025

Figured out why things are abruptly cancelled, it's because of https://docs.rs/tokio/latest/tokio/macro.select.html

@milesj
Copy link
Collaborator

milesj commented Feb 3, 2025

Give v1.32 a try.

@JeremyMoeglich
Copy link
Author

JeremyMoeglich commented Feb 3, 2025

Don't think this works, from what I remember an older version of the 1.32-process branch did work, right now I am on linux.

~/dev/moonwaitreproduction on  main! ⌚ 4:02:11
$ moon run root:slow_drop        
▪▪▪▪ root:slow_drop
^CSignal received, waiting 10 seconds
▪▪▪▪ root:slow_drop (8s 293ms)

Tasks: 1 skipped
 Time: 8s 294ms (interrupted)

~/dev/moonwaitreproduction on  main! ⌚ 4:02:25
$ moon --version         
moon 1.32.0

./target/release/slow_drop
^CSignal received, waiting 10 seconds
done

Here is the full log

./moon132 run root:slow_drop --log trace
[DEBUG 2025-02-03 04:22:58.735] moon  Running moon v1.32.0 (with ~/dev/moonwaitreproduction/moon132)  args=["./moon132", "run", "root:slow_drop", "--log", "trace"]
[DEBUG 04:22:58.735] moon_app::session  Creating new application session 
[TRACE 04:22:58.735] moon_console::console  Creating buffered console 
[TRACE 04:22:58.735] starbase::app  Running startup phase 
[DEBUG 04:22:58.735] moon_app::systems::startup  Attempting to find workspace root from current working directory  working_dir="/home/jeremy/dev/moonwaitreproduction"
[TRACE 04:22:58.735] starbase_utils::fs  Traversing upwards to find a file/root  file=".moon" dir="/home/jeremy/dev/moonwaitreproduction"
[DEBUG 04:22:58.735] moon_app::systems::startup  Found workspace root  workspace_root="/home/jeremy/dev/moonwaitreproduction" working_dir="/home/jeremy/dev/moonwaitreproduction"
[DEBUG 04:22:58.735] moon_env  Creating moon environment, detecting store  store="/home/jeremy/.moon"
[DEBUG 04:22:58.735] proto_core::proto  Creating proto environment, detecting store  store="/home/jeremy/.proto" home="/home/jeremy"
[DEBUG 04:22:58.735] moon_app::systems::startup  Loading .moon/workspace.{pkl,yml} (required) 
[DEBUG 04:22:58.735] moon_app::systems::startup  Attempting to load .moon/tasks.{pkl,yml} and .moon/tasks/**/*.{pkl,yml} (optional) 
[DEBUG 04:22:58.735] moon_app::systems::startup  Attempting to load .moon/toolchain.{pkl,yml} (optional) 
[DEBUG 04:22:58.736] moon_app::systems::startup  Loaded 0 task configs to inherit  scopes=[]
[DEBUG 04:22:58.736] proto_core::proto_config  Loading .prototools  file="/home/jeremy/dev/moonwaitreproduction/.prototools"
[TRACE 04:22:58.736] starbase_utils::fs  Reading file  file="/home/jeremy/dev/moonwaitreproduction/.prototools"
[TRACE 04:22:58.736] schematic::config::loader  Loading configuration  config="WorkspaceConfig"
[TRACE 04:22:58.736] schematic::config::loader  Loading partial configuration  config="ProtoConfig"
[TRACE 04:22:58.736] schematic::config::loader  Creating layer from source  config="WorkspaceConfig" source="/home/jeremy/dev/moonwaitreproduction/.moon/workspace.yml"
[TRACE 04:22:58.736] schematic::config::loader  Creating layer from source  config="ProtoConfig" source="<code>"
[TRACE 04:22:58.736] schematic::config::loader  Merging partial layers into a final result  config="ProtoConfig"
[DEBUG 04:22:58.736] proto_core::proto_config  Loading .prototools  file="/home/jeremy/.prototools"
[TRACE 04:22:58.736] starbase_utils::fs  Reading file  file="/home/jeremy/.prototools"
[TRACE 04:22:58.736] schematic::config::loader  Loading partial configuration  config="ProtoConfig"
[TRACE 04:22:58.736] schematic::config::loader  Creating layer from source  config="ProtoConfig" source="<code>"
[TRACE 04:22:58.736] schematic::config::loader  Creating layer from source  config="WorkspaceConfig" source="/home/jeremy/dev/moonwaitreproduction/.moon/workspace.pkl"
[TRACE 04:22:58.736] schematic::config::loader  Merging partial layers into a final result  config="WorkspaceConfig"
[TRACE 04:22:58.736] schematic::config::loader  Merging partial layers into a final result  config="ProtoConfig"
[DEBUG 04:22:58.736] proto_core::proto_config  Loading .prototools  file="/home/jeremy/.proto/.prototools"
[TRACE 04:22:58.736] starbase_utils::fs  Opening file  file="/home/jeremy/.proto/.prototools"
[TRACE 04:22:58.736] starbase_utils::fs_lock  Locking file  file="/home/jeremy/.proto/.prototools"
[TRACE 04:22:58.736] starbase_utils::fs_lock  Unlocking file  file="/home/jeremy/.proto/.prototools"
[TRACE 04:22:58.736] schematic::config::loader  Loading partial configuration  config="ProtoConfig"
[TRACE 04:22:58.736] schematic::config::loader  Creating layer from source  config="ProtoConfig" source="<code>"
[TRACE 04:22:58.736] schematic::config::loader  Merging partial layers into a final result  config="ProtoConfig"
[DEBUG 04:22:58.736] proto_core::proto_config  Loading local config only 
[DEBUG 04:22:58.736] proto_core::proto_config  Merged 1 configs 
[TRACE 04:22:58.736] schematic::config::loader  Loading configuration  config="ToolchainConfig"
[TRACE 04:22:58.736] schematic::config::loader  Creating layer from source  config="ToolchainConfig" source="/home/jeremy/dev/moonwaitreproduction/.moon/toolchain.yml"
[TRACE 04:22:58.736] schematic::config::loader  Creating layer from source  config="ToolchainConfig" source="/home/jeremy/dev/moonwaitreproduction/.moon/toolchain.pkl"
[TRACE 04:22:58.736] schematic::config::loader  Merging partial layers into a final result  config="ToolchainConfig"
[TRACE 04:22:58.737] starbase::app  Running analyze phase 
[DEBUG 04:22:58.737] moon_cache::cache_engine  Creating cache engine  cache_dir="/home/jeremy/dev/moonwaitreproduction/.moon/cache"
[DEBUG 04:22:58.737] moon_cache::hash_engine  Creating hash engine  hashes_dir="/home/jeremy/dev/moonwaitreproduction/.moon/cache/hashes" outputs_dir="/home/jeremy/dev/moonwaitreproduction/.moon/cache/outputs"
[DEBUG 04:22:58.737] moon_cache::state_engine  Creating states engine  states_dir="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states"
[TRACE 04:22:58.737] starbase_utils::fs_lock  Locking file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/proto-install.lock"
[TRACE 04:22:58.737] starbase_utils::fs  Creating file without truncating  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/proto-install.lock"
[TRACE 04:22:58.737] starbase_utils::fs_lock  Waiting to acquire lock  lock="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/proto-install.lock"
[TRACE 04:22:58.737] starbase_utils::fs_lock  Acquired lock, writing PID  lock="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/proto-install.lock" pid=54786
[DEBUG 04:22:58.737] moon_app::systems::analyze  Checking if proto is installed  proto="/home/jeremy/.proto/tools/proto/0.45.1/proto"
[TRACE 04:22:58.737] starbase_utils::fs_lock  Unlocking path  path="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/proto-install.lock"
[TRACE 04:22:58.737] starbase_utils::fs  Removing file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/proto-install.lock"
[DEBUG 04:22:58.737] moon_app::systems::analyze  Registering platforms based on toolchain configuration  platforms=[]
[TRACE 04:22:58.737] starbase::app  Running execute phase 
[DEBUG 04:22:58.737] moon_vcs::git  Using git as a version control system 
[DEBUG 04:22:58.737] moon_vcs::git  Attempting to find a .git directory or file  starting_dir="/home/jeremy/dev/moonwaitreproduction"
[DEBUG 04:22:58.737] moon_vcs::git  Found a .git directory (repository root)  git="/home/jeremy/dev/moonwaitreproduction/.git"
[DEBUG 04:22:58.737] moon_cache_item::cache_item  Cache hit, reading item  cache="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/moonVersionCheck.json"
[DEBUG 04:22:58.737] moon_vcs::git  Loading ignore rules from .gitignore  ignore_file="/home/jeremy/dev/moonwaitreproduction/.gitignore"
[TRACE 04:22:58.737] starbase_utils::fs  Reading file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/moonVersionCheck.json"
[TRACE 04:22:58.737] starbase_utils::json  Reading JSON file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/moonVersionCheck.json"
[DEBUG 04:22:58.737] moon_workspace::workspace_builder  Building workspace graph (project and task graphs) 
[DEBUG 04:22:58.737] moon_workspace::workspace_builder  Using configured project sources  sources=[(root, ".")]
[DEBUG 04:22:58.737] moon_workspace::workspace_builder  Loading projects 
[TRACE 04:22:58.738] moon_workspace::workspace_builder  Attempting to load ./moon.{pkl,yml} (optional)  project_id="root"
[TRACE 04:22:58.738] schematic::config::loader  Loading configuration  config="ProjectConfig"
[TRACE 04:22:58.738] schematic::config::loader  Creating layer from source  config="ProjectConfig" source="/home/jeremy/dev/moonwaitreproduction/./moon.yml"
[TRACE 04:22:58.738] schematic::config::loader  Creating layer from source  config="ProjectConfig" source="/home/jeremy/dev/moonwaitreproduction/./moon.pkl"
[TRACE 04:22:58.738] schematic::config::loader  Merging partial layers into a final result  config="ProjectConfig"
[DEBUG 04:22:58.738] moon_workspace::workspace_builder  Loaded 1 projects 
[DEBUG 04:22:58.738] moon_workspace::workspace_builder  Extending project graph with aliases 
[DEBUG 04:22:58.741] starbase_shell::shell  Attempting to detect the current shell 
[DEBUG 04:22:58.741] starbase_shell::shell  Detecting from SHELL environment variable  env="/usr/bin/zsh"
[DEBUG 04:22:58.741] starbase_shell::shell  Detected zsh shell 
[DEBUG 04:22:58.741] moon_process::signal::unix  Listening for SIGINT, SIGQUIT, and SIGTERM signals 
[DEBUG 04:22:58.741] moon_process::exec_command  Running command git hash-object --stdin-paths - './moon.yml .moon/workspace.yml'  pid=54808 env={} cwd="/home/jeremy/dev/moonwaitreproduction"
[TRACE 04:22:58.742] moon_hash::hasher  Created new content hasher  label="Workspace graph"
[TRACE 04:22:58.742] moon_hash::hasher  Adding content to hasher  label="Workspace graph"
[TRACE 04:22:58.742] starbase_utils::json  Formatting JSON 
[DEBUG 04:22:58.742] moon_hash::hasher  Generated content hash  label="Workspace graph" hash="344d471267c17a5d44ed15efff194b9268217e323a056cef618c678363faa39e"
[DEBUG 04:22:58.742] moon_cache::hash_engine  Saving hash manifest  label="Workspace graph" manifest="/home/jeremy/dev/moonwaitreproduction/.moon/cache/hashes/344d471267c17a5d44ed15efff194b9268217e323a056cef618c678363faa39e.json"
[TRACE 04:22:58.742] starbase_utils::fs  Writing file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/hashes/344d471267c17a5d44ed15efff194b9268217e323a056cef618c678363faa39e.json"
[DEBUG 04:22:58.742] moon_workspace::workspace_builder  Generated hash for workspace graph  hash="344d471267c17a5d44ed15efff194b9268217e323a056cef618c678363faa39e"
[DEBUG 04:22:58.742] moon_cache_item::cache_item  Cache hit, reading item  cache="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/projectsBuildData.json"
[TRACE 04:22:58.742] starbase_utils::fs  Reading file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/projectsBuildData.json"
[TRACE 04:22:58.742] starbase_utils::json  Reading JSON file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/projectsBuildData.json"
[DEBUG 04:22:58.743] moon_workspace::workspace_builder  Loading workspace graph with 1 projects from cache  cache="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/workspaceGraph.json"
[TRACE 04:22:58.743] starbase_utils::fs  Reading file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/workspaceGraph.json"
[TRACE 04:22:58.743] starbase_utils::json  Reading JSON file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/workspaceGraph.json"
[DEBUG 04:22:58.743] moon_workspace::workspace_builder  Enforcing project constraints 
[DEBUG 04:22:58.743] moon_process::exec_command  Running command git --version  pid=54809 env={} cwd="/home/jeremy/dev/moonwaitreproduction"
[DEBUG 04:22:58.744] moon_process::exec_command  Running command git branch --show-current  pid=54810 env={} cwd="/home/jeremy/dev/moonwaitreproduction"
[DEBUG 04:22:58.745] moon_process::exec_command  Running command git rev-parse HEAD  pid=54811 env={} cwd="/home/jeremy/dev/moonwaitreproduction"
[DEBUG 04:22:58.746] moon_process::exec_command  Running command git remote get-url origin  pid=54812 env={} cwd="/home/jeremy/dev/moonwaitreproduction"
[DEBUG 04:22:58.747] moon_project_graph::project_graph  Creating project graph 
[DEBUG 04:22:58.747] moon_task_graph::task_graph  Creating task graph 
[DEBUG 04:22:58.747] moon_app::queries::touched_files  Querying for touched files 
[TRACE 04:22:58.747] moon_app::queries::touched_files  Against local 
[DEBUG 04:22:58.748] moon_process::exec_command  Running command git status --porcelain --untracked-files --ignore-submodules -z  pid=54813 env={} cwd="/home/jeremy/dev/moonwaitreproduction"
[DEBUG 04:22:58.750] moon_app::queries::touched_files  Filtering based on touched status all 
[DEBUG 04:22:58.750] moon_app::queries::touched_files  Found touched files  files=["Cargo.lock", "src/bin/send_signal.rs", "Cargo.toml", "signal_received", ".prototools", "moon131", "src/bin/slow_drop.rs", "moon132", "src/bin/signal.rs", "moon.yml"]
[DEBUG 04:22:58.750] moon_action_graph::action_graph_builder  Building action graph 
[DEBUG 04:22:58.750] moon_project_expander::project_expander  Expanding project root  project_id="root"
[DEBUG 04:22:58.750] moon_task_expander::task_expander  Expanding task root:slow_drop  task_target="root:slow_drop"
[TRACE 04:22:58.750] moon_task_expander::task_expander  Expanding tokens and variables in command  task_target="root:slow_drop" command="target/release/slow_drop"
[TRACE 04:22:58.750] moon_task_expander::task_expander  Expanding environment variables  task_target="root:slow_drop" env={}
[TRACE 04:22:58.750] moon_task_expander::task_expander  Expanding inputs into file system paths  task_target="root:slow_drop" inputs=["**/*", ".moon/*.{pkl,yml}"]
[DEBUG 04:22:58.750] moon_action_graph::action_graph_builder  Project root is not within the dependency manager workspace, dependencies will be installed within the project instead of the root 
[DEBUG 04:22:58.750] moon_action_graph::action_graph_builder  Adding SyncWorkspace to graph  index=0
[DEBUG 04:22:58.750] moon_action_graph::action_graph_builder  Adding SetupToolchain(system) to graph  index=1
[TRACE 04:22:58.750] moon_action_graph::action_graph_builder  Linking requirements for index  index=1 requires=[0]
[DEBUG 04:22:58.750] moon_action_graph::action_graph_builder  Adding SyncProject(system, root) to graph  index=2
[TRACE 04:22:58.750] moon_action_graph::action_graph_builder  Linking requirements for index  index=2 requires=[1]
[DEBUG 04:22:58.750] moon_action_graph::action_graph_builder  Adding RunPersistentTask(root:slow_drop) to graph  index=3
[TRACE 04:22:58.750] moon_action_graph::action_graph_builder  Linking requirements for index  index=3 requires=[2]
[DEBUG 04:22:58.750] moon_action_graph::action_graph  Creating action graph 
[DEBUG 04:22:58.750] moon_plugin::plugin_registry  Creating plugin registry  plugin="toolchain"
[TRACE 04:22:58.750] warpgate::loader  Creating plugin loader  cache_dir="/home/jeremy/.moon/plugins/toolchains"
[DEBUG 04:22:58.750] moon_action_pipeline::action_pipeline  Creating pipeline to run actions 
[DEBUG 04:22:58.750] moon_action_pipeline::action_pipeline  Registering event subscribers 
[DEBUG 04:22:58.750] moon_action_pipeline::action_pipeline  Subscribing run reports and estimates 
[DEBUG 04:22:58.750] moon_action_pipeline::action_pipeline  Subscribing cache cleanup (runner.autoCleanCache enabled)  lifetime="7 days"
[DEBUG 04:22:58.750] moon_action_pipeline::action_pipeline  Starting pipeline  total_actions=4 concurrency=16
[DEBUG 04:22:58.750] moon_action_graph::action_graph  Sorting action graph topologically  order=[0, 1, 2, 3]
[DEBUG 04:22:58.750] moon_action_pipeline::action_pipeline  Dispatching jobs in the pipeline  total_jobs=4
[DEBUG 04:22:58.750] moon_action_pipeline::action_pipeline  Waiting for jobs to return results 
[TRACE 04:22:58.750] moon_action_pipeline::job_dispatcher  Dispatching job  index=0 deps=[]
[TRACE 04:22:58.750] moon_action_pipeline::action_runner  Running action SyncWorkspace  index=0
[TRACE 04:22:58.750] starbase_utils::fs_lock  Locking file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/syncWorkspace.lock"
[TRACE 04:22:58.750] starbase_utils::fs  Creating file without truncating  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/syncWorkspace.lock"
[TRACE 04:22:58.750] starbase_utils::fs_lock  Waiting to acquire lock  lock="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/syncWorkspace.lock"
[TRACE 04:22:58.750] starbase_utils::fs_lock  Acquired lock, writing PID  lock="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/syncWorkspace.lock" pid=54786
[DEBUG 04:22:58.750] moon_actions::actions::sync_workspace  Syncing workspace 
[DEBUG 04:22:58.750] moon_actions::actions::sync_workspace  Syncing config schemas 
[DEBUG 04:22:58.750] moon_cache_item::cache_item  Cache hit, reading item  cache="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/configSchemas.json"
[TRACE 04:22:58.750] starbase_utils::fs  Reading file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/configSchemas.json"
[TRACE 04:22:58.750] starbase_utils::json  Reading JSON file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/configSchemas.json"
[TRACE 04:22:58.750] moon_hash::hasher  Created new content hasher  label="configSchemas.json"
[TRACE 04:22:58.750] moon_hash::hasher  Adding content to hasher  label="configSchemas.json"
[TRACE 04:22:58.750] starbase_utils::json  Formatting JSON 
[DEBUG 04:22:58.750] moon_hash::hasher  Generated content hash  label="configSchemas.json" hash="c969f26c8def0b369137616dca542d01690b8756784231ded82cc79ec2428bb3"
[DEBUG 04:22:58.751] moon_cache::hash_engine  Saving hash manifest  label="configSchemas.json" manifest="/home/jeremy/dev/moonwaitreproduction/.moon/cache/hashes/c969f26c8def0b369137616dca542d01690b8756784231ded82cc79ec2428bb3.json"
[TRACE 04:22:58.751] starbase_utils::fs  Writing file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/hashes/c969f26c8def0b369137616dca542d01690b8756784231ded82cc79ec2428bb3.json"
[TRACE 04:22:58.751] starbase_utils::fs_lock  Unlocking path  path="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/syncWorkspace.lock"
[TRACE 04:22:58.751] starbase_utils::fs  Removing file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/syncWorkspace.lock"
[TRACE 04:22:58.751] moon_action_pipeline::action_runner  Ran action SyncWorkspace in 524.988µs  index=0 status=Passed
[TRACE 04:22:58.751] moon_action_pipeline::job_dispatcher  Dispatching job  index=1 deps=[0]
[TRACE 04:22:58.751] moon_action_pipeline::action_runner  Running action SetupToolchain(system)  index=1
[TRACE 04:22:58.751] starbase_utils::fs_lock  Locking file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/setupToolchain-system-global.lock"
[TRACE 04:22:58.751] starbase_utils::fs  Creating file without truncating  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/setupToolchain-system-global.lock"
[TRACE 04:22:58.751] starbase_utils::fs_lock  Waiting to acquire lock  lock="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/setupToolchain-system-global.lock"
[TRACE 04:22:58.751] starbase_utils::fs_lock  Acquired lock, writing PID  lock="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/setupToolchain-system-global.lock" pid=54786
[DEBUG 04:22:58.751] moon_actions::actions::setup_toolchain  Setting up system toolchain 
[DEBUG 04:22:58.751] moon_cache_item::cache_item  Cache hit, reading item  cache="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/setupToolchain-system-global.json"
[TRACE 04:22:58.751] starbase_utils::fs  Reading file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/setupToolchain-system-global.json"
[TRACE 04:22:58.751] starbase_utils::json  Reading JSON file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/setupToolchain-system-global.json"
[DEBUG 04:22:58.751] moon_cache_item::cache_item  Writing cache item  cache="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/setupToolchain-system-global.json"
[TRACE 04:22:58.751] starbase_utils::json  Writing JSON file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/setupToolchain-system-global.json"
[TRACE 04:22:58.751] starbase_utils::fs  Writing file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/setupToolchain-system-global.json"
[TRACE 04:22:58.751] starbase_utils::fs_lock  Unlocking path  path="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/setupToolchain-system-global.lock"
[TRACE 04:22:58.751] starbase_utils::fs  Removing file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/setupToolchain-system-global.lock"
[TRACE 04:22:58.751] moon_action_pipeline::action_runner  Ran action SetupToolchain(system) in 533.908µs  index=1 status=Skipped
[TRACE 04:22:58.751] moon_action_pipeline::job_dispatcher  Dispatching job  index=2 deps=[1]
[TRACE 04:22:58.751] moon_action_pipeline::action_runner  Running action SyncProject(system, root)  index=2
[DEBUG 04:22:58.751] moon_task_expander::task_expander  Expanding task root:interactive_signal  task_target="root:interactive_signal"
[TRACE 04:22:58.751] moon_task_expander::task_expander  Expanding tokens and variables in command  task_target="root:interactive_signal" command="target/release/signal"
[TRACE 04:22:58.751] moon_task_expander::task_expander  Expanding environment variables  task_target="root:interactive_signal" env={}
[TRACE 04:22:58.751] moon_task_expander::task_expander  Expanding inputs into file system paths  task_target="root:interactive_signal" inputs=["**/*", ".moon/*.{pkl,yml}"]
[DEBUG 04:22:58.752] moon_task_expander::task_expander  Expanding task root:persistent_signal  task_target="root:persistent_signal"
[TRACE 04:22:58.752] moon_task_expander::task_expander  Expanding tokens and variables in command  task_target="root:persistent_signal" command="target/release/signal"
[TRACE 04:22:58.752] moon_task_expander::task_expander  Expanding environment variables  task_target="root:persistent_signal" env={}
[TRACE 04:22:58.752] moon_task_expander::task_expander  Expanding inputs into file system paths  task_target="root:persistent_signal" inputs=["**/*", ".moon/*.{pkl,yml}"]
[TRACE 04:22:58.752] starbase_utils::fs_lock  Locking file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/syncProject-root.lock"
[TRACE 04:22:58.752] starbase_utils::fs  Creating file without truncating  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/syncProject-root.lock"
[TRACE 04:22:58.752] starbase_utils::fs_lock  Waiting to acquire lock  lock="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/syncProject-root.lock"
[TRACE 04:22:58.752] starbase_utils::fs_lock  Acquired lock, writing PID  lock="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/syncProject-root.lock" pid=54786
[DEBUG 04:22:58.752] moon_actions::actions::sync_project  Syncing project root 
[DEBUG 04:22:58.752] moon_cache::state_engine  Writing project snapshot  cache="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/root/snapshot.json"
[TRACE 04:22:58.752] starbase_utils::json  Writing JSON file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/root/snapshot.json"
[TRACE 04:22:58.752] starbase_utils::fs  Writing file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/root/snapshot.json"
[TRACE 04:22:58.752] starbase_utils::fs_lock  Unlocking path  path="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/syncProject-root.lock"
[TRACE 04:22:58.752] starbase_utils::fs  Removing file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/locks/syncProject-root.lock"
[TRACE 04:22:58.752] moon_action_pipeline::action_runner  Ran action SyncProject(system, root) in 528.368µs  index=2 status=Passed
[TRACE 04:22:58.752] moon_action_pipeline::job_dispatcher  Dispatching job  index=3 deps=[2]
[TRACE 04:22:58.752] moon_action_pipeline::action_pipeline  Marking action as persistent, will defer dispatch  index=3
[DEBUG 04:22:58.752] moon_action_pipeline::action_pipeline  Running 1 persistent actions  indices=[NodeIndex(3)]
[TRACE 04:22:58.752] moon_action_pipeline::action_runner  Running action RunPersistentTask(root:slow_drop)  index=3
[DEBUG 04:22:58.752] moon_task_runner::task_runner  Creating a task runner for target  task_target="root:slow_drop"
[DEBUG 04:22:58.752] moon_cache_item::cache_item  Cache hit, reading item  cache="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/root/slow_drop/lastRun.json"
[TRACE 04:22:58.752] starbase_utils::fs  Reading file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/root/slow_drop/lastRun.json"
[TRACE 04:22:58.752] starbase_utils::json  Reading JSON file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/root/slow_drop/lastRun.json"
[DEBUG 04:22:58.752] moon_task_runner::task_runner  Caching is disabled for task, will not generate a hash, and will attempt to run a command as normal  task_target="root:slow_drop"
[DEBUG 04:22:58.752] moon_task_runner::task_runner  Building and executing the task command  task_target="root:slow_drop"
[DEBUG 04:22:58.752] moon_task_runner::command_builder  Creating task command to execute  task_target="root:slow_drop" command="target/release/slow_drop" working_dir="/home/jeremy/dev/moonwaitreproduction"
[DEBUG 04:22:58.752] moon_task_runner::command_executor  Running task (attempt 1 of 1)  task_target="root:slow_drop" command="target/release/slow_drop"
[DEBUG 04:22:58.752] moon_process::exec_command  Running command /usr/bin/zsh -c target/release/slow_drop  pid=54814 shell="zsh" env={"MOON_PROJECT_SOURCE": ".", "MOON_CACHE_DIR": "/home/jeremy/dev/moonwaitreproduction/.moon/cache", "MOON_WORKING_DIR": "/home/jeremy/dev/moonwaitreproduction", "MOON_PROJECT_ID": "root", "MOON_PROJECT_SNAPSHOT": "/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/root/snapshot.json", "MOON_PROJECT_ROOT": "/home/jeremy/dev/moonwaitreproduction", "MOON_WORKSPACE_ROOT": "/home/jeremy/dev/moonwaitreproduction", "MOON_TARGET": "root:slow_drop"} cwd="/home/jeremy/dev/moonwaitreproduction"
▪▪▪▪ root:slow_drop
^CSignal received, waiting 10 seconds
[DEBUG 04:23:01.653] moon_process::signal::unix  Received SIGINT signal 
[DEBUG 04:23:01.653] moon_action_pipeline::action_pipeline  Received signal, shutting down pipeline 
[DEBUG 04:23:03.654] moon_process::process_registry  Killing 1 running child processes  pids=[54814]
[TRACE 04:23:03.654] moon_process::process_registry  Killing child process  pid=54814
[DEBUG 04:23:03.654] moon_task_runner::command_executor  Ran task, checking conditions  task_target="root:slow_drop" command="target/release/slow_drop"
[DEBUG 04:23:03.654] moon_task_runner::command_executor  Task was unsuccessful, failing as we hit our max attempts  task_target="root:slow_drop"
[TRACE 04:23:03.654] starbase_utils::fs  Writing file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/root/slow_drop/stderr.log"
[TRACE 04:23:03.654] starbase_utils::fs  Writing file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/root/slow_drop/stdout.log"
[DEBUG 04:23:03.654] moon_cache_item::cache_item  Writing cache item  cache="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/root/slow_drop/lastRun.json"
[TRACE 04:23:03.654] starbase_utils::json  Writing JSON file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/root/slow_drop/lastRun.json"
[TRACE 04:23:03.654] starbase_utils::fs  Writing file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/states/root/slow_drop/lastRun.json"
[TRACE 04:23:03.655] moon_action_pipeline::action_runner  Failed to run action RunPersistentTask(root:slow_drop)  index=3 status=Failed
[TRACE 04:23:03.655] moon_action_pipeline::job  Job cancelled (via signal)  index=3
[DEBUG 04:23:03.655] moon_action_pipeline::action_pipeline  Cancelling pipeline (via signal) 
[DEBUG 04:23:03.655] moon_action_pipeline::action_pipeline  Aborting running actions 
[DEBUG 04:23:03.655] moon_action_pipeline::subscribers::reports_subscriber  Creating run report 
[DEBUG 04:23:03.655] moon_action_pipeline::reports::estimate  Calculating a comparison estimate against other build systems 
[DEBUG 04:23:03.655] moon_cache::cache_engine  Writing cache  cache="/home/jeremy/dev/moonwaitreproduction/.moon/cache/runReport.json"
[TRACE 04:23:03.655] starbase_utils::json  Writing JSON file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/runReport.json"
[TRACE 04:23:03.655] starbase_utils::fs  Writing file  file="/home/jeremy/dev/moonwaitreproduction/.moon/cache/runReport.json"
[TRACE 04:23:03.655] starbase::app  Running shutdown phase 
[TRACE 04:23:03.655] moon_console::console  Closing console and flushing buffered output 
[TRACE 04:23:03.655] moon_console::buffer  Closing stderr stream 
[TRACE 04:23:03.655] moon_console::buffer  Closing stdout stream 
▪▪▪▪ root:slow_drop (4s 902ms)

Tasks: 1 skipped
 Time: 4s 904ms (interrupted)

@milesj
Copy link
Collaborator

milesj commented Feb 3, 2025

It's working according to the logs, but there's also a threshold (2 seconds) right now that will kill that processes if they take too long to shutdown. I can probably make this configurable.

@JeremyMoeglich
Copy link
Author

2 seconds should be fine for most things. I'll test windows in a bit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants