Skip to content

Commit

Permalink
Merge pull request #67 from YOU54F/issue/win_plugin_shutdown
Browse files Browse the repository at this point in the history
fix: win plugin shutdown
  • Loading branch information
rholshausen authored Jul 5, 2024
2 parents 7fe7d92 + 53914bd commit c6dd2dd
Show file tree
Hide file tree
Showing 15 changed files with 4,353 additions and 2,091 deletions.
888 changes: 619 additions & 269 deletions cli/Cargo.lock

Large diffs are not rendered by default.

41 changes: 23 additions & 18 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,31 @@ exclude = [
]

[dependencies]
pact-plugin-driver = "0.4.6"
pact-plugin-driver = "0.6.2"
clap = { version = "4.4.11", features = [ "derive", "cargo" ] }
comfy-table = "7.1.0"
home = "0.5.5"
anyhow = "1.0.75"
serde = { version = "1.0.193", features = [ "derive" ] }
serde_json = "1.0.108"
itertools = "0.12.0"
comfy-table = "7.1.1"
home = "0.5.9"
anyhow = "1.0.86"
serde = { version = "1.0.203", features = [ "derive" ] }
serde_json = "1.0.120"
itertools = "0.13.0"
requestty = "0.5.0"
reqwest = { version = "0.11.22", default-features = false, features = ["rustls-tls-native-roots", "json", "stream"] }
reqwest = { version = "0.12.5", default-features = false, features = ["rustls-tls-native-roots", "json", "stream"] }
tokio = { version = "1", features = ["full"] }
tracing = "0.1.37"
tracing-subscriber = "0.3.16"
chrono = { version = "0.4.31", features = ["serde"]}
toml = "0.8.8"
url = "2.5.0"
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
chrono = { version = "0.4.22", features = ["serde"]}
toml = "0.8.14"
url = "2.5.2"
parse-zoneinfo = "0.3.1" # requires pact_model to be updated
# https://github.com/chronotope/parse-zoneinfo/commit/61557cd5407e494770285d1925d64c42973f5db0

[dev-dependencies]
trycmd = "0.14.19"
tempfile = "3.8.1"
trycmd = "0.15.4"
tempfile = "3.10.1"
expectest = "0.12.0"
test-log = "0.2.14"
env_logger = "0.10.1"
test-log = "0.2.16"
env_logger = "0.11.3"

[profile.release]
strip = true
Expand All @@ -47,4 +49,7 @@ lto = true
# References
# https://doc.rust-lang.org/stable/rustc/codegen-options/
# https://doc.rust-lang.org/rustc/profile-guided-optimization.html
# https://github.com/johnthagen/min-sized-rust
# https://github.com/johnthagen/min-sized-rust

[patch.crates-io]
pact-plugin-driver = { version = "0.6.2", path = "../drivers/rust/driver" }
4 changes: 2 additions & 2 deletions drivers/rust/driver/src/child_process_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::time::Duration;

use anyhow::anyhow;
use serde::{Deserialize, Serialize};
use sysinfo::{Pid, Signal, System};
use sysinfo::{Pid, System};
use tracing::{debug, error, trace, warn};

use crate::plugin_models::PactPluginManifest;
Expand Down Expand Up @@ -118,7 +118,7 @@ impl ChildPluginProcess {
let mut s = System::new();
s.refresh_processes();
if let Some(process) = s.process(Pid::from_u32(self.child_pid as u32)) {
process.kill_with(Signal::Term);
process.kill();
} else {
warn!("Child process with PID {} was not found", self.child_pid);
}
Expand Down
5 changes: 3 additions & 2 deletions drivers/rust/driver/src/plugin_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ use pact_models::v4::interaction::V4Interaction;
use reqwest::Client;
use semver::Version;
use serde_json::Value;
use sysinfo::{Pid, Signal, System};
use sysinfo::{Pid,System};
#[cfg(not(windows))] use sysinfo::Signal;
#[cfg(not(windows))] use tokio::process::Command;
use tracing::{debug, info, trace, warn};

Expand Down Expand Up @@ -337,7 +338,7 @@ async fn start_plugin_process(manifest: &PactPluginManifest) -> anyhow::Result<P
let mut s = System::new();
s.refresh_processes();
if let Some(process) = s.process(Pid::from_u32(child_pid)) {
process.kill_with(Signal::Term);
process.kill();
} else {
warn!("Child process with PID {} was not found", child_pid);
}
Expand Down
Loading

0 comments on commit c6dd2dd

Please sign in to comment.