diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2019-10-29 10:46:16 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2019-10-29 10:50:30 +0100 |
| commit | 9a33040939cfb76f77a80392dc56604521362e56 (patch) | |
| tree | 148eeb7f2e0ae8e6f27af9ef52dcc1d0f80e1666 | |
| parent | 2a20e8b56cce072d2c5fb9e2b21363e8fd62c231 (diff) | |
| download | mullvadvpn-9a33040939cfb76f77a80392dc56604521362e56.tar.xz mullvadvpn-9a33040939cfb76f77a80392dc56604521362e56.zip | |
Add more debug logging around focefully killing OpenVPN
| -rw-r--r-- | talpid-core/src/process/openvpn.rs | 5 | ||||
| -rw-r--r-- | talpid-core/src/process/stoppable_process.rs | 10 |
2 files changed, 9 insertions, 6 deletions
diff --git a/talpid-core/src/process/openvpn.rs b/talpid-core/src/process/openvpn.rs index b1353834d3..ea43e12494 100644 --- a/talpid-core/src/process/openvpn.rs +++ b/talpid-core/src/process/openvpn.rs @@ -394,7 +394,10 @@ impl StoppableProcess for OpenVpnProcHandle { } fn kill(&self) -> io::Result<()> { - self.inner.kill() + log::warn!("Killing OpenVPN process"); + self.inner.kill()?; + log::debug!("OpenVPN forcefully killed"); + Ok(()) } fn has_stopped(&self) -> io::Result<bool> { diff --git a/talpid-core/src/process/stoppable_process.rs b/talpid-core/src/process/stoppable_process.rs index 18a24dd7bd..3681c6cfa8 100644 --- a/talpid-core/src/process/stoppable_process.rs +++ b/talpid-core/src/process/stoppable_process.rs @@ -1,4 +1,3 @@ -use log::{debug, info, trace, warn}; use std::{ io, thread, time::{Duration, Instant}, @@ -24,14 +23,15 @@ where /// Attempts to stop a process gracefully in the given time period, otherwise kills the /// process. fn nice_kill(&self, timeout: Duration) -> io::Result<()> { - trace!("Trying to stop child process gracefully"); + log::debug!("Trying to stop child process gracefully"); self.stop(); if wait_timeout(self, timeout)? { - debug!("Child process terminated gracefully"); + log::debug!("Child process terminated gracefully"); } else { - warn!("Child process did not terminate gracefully within timeout, forcing termination"); + log::warn!( + "Child process did not terminate gracefully within timeout, forcing termination" + ); self.kill()?; - info!("Child process killed"); } Ok(()) } |
