Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions crates/tower-runtime/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@ async fn execute_local_app(opts: StartOptions, sx: oneshot::Sender<i32>, cancel_
return Ok(())
}

impl Drop for LocalApp {
fn drop(&mut self) {
// We want to ensure that we cancel the process if it is still running.
let _ = self.terminate();
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Silently ignoring the result of terminate() may hide important errors. Consider logging the error or at least adding a comment explaining why the error is intentionally ignored.

Copilot uses AI. Check for mistakes.
}
}

impl App for LocalApp {
async fn start(opts: StartOptions) -> Result<Self, Error> {
let cancel_token = CancellationToken::new();
Expand Down
4 changes: 4 additions & 0 deletions crates/tower-uv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ impl Uv {
debug!("Executing UV ({:?}) venv in {:?}", &self.uv_path, cwd);

let child = Command::new(&self.uv_path)
.kill_on_drop(true)
.stdin(Stdio::null())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
Expand All @@ -95,6 +96,7 @@ impl Uv {
if cwd.join("pyproject.toml").exists() {
debug!("Executing UV ({:?}) sync in {:?}", &self.uv_path, cwd);
let child = Command::new(&self.uv_path)
.kill_on_drop(true)
.stdin(Stdio::null())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
Expand All @@ -112,6 +114,7 @@ impl Uv {

// If there is a requirements.txt, then we can use that to sync.
let child = Command::new(&self.uv_path)
.kill_on_drop(true)
.stdin(Stdio::null())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
Expand All @@ -138,6 +141,7 @@ impl Uv {
debug!("Executing UV ({:?}) run {:?} in {:?}", &self.uv_path, program, cwd);

let child = Command::new(&self.uv_path)
.kill_on_drop(true)
.stdin(Stdio::null())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
Expand Down
Loading