From 7cbbc015980c5db4d517b62523cf8488296fa2fd Mon Sep 17 00:00:00 2001 From: Ben Frederickson Date: Fri, 15 Dec 2023 16:50:19 -0800 Subject: [PATCH] Fix error handling in sampler.rs (#645) We were calling unwrap_err when failing to create a PythonSpy object in sampler.rs (on the result of sending the error on a channel), when we should have been calling unwrap. Fix. See #644 Also fix freebsd ci --- .github/workflows/build.yml | 1 + src/sampler.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 77fe875e..0b74c603 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -145,6 +145,7 @@ jobs: run: lscpu - name: Install VM tools run: | + sudo apt-get update -qq sudo apt-get install -qq -o=Dpkg::Use-Pty=0 moreutils sudo chronic apt-get install -qq -o=Dpkg::Use-Pty=0 vagrant virtualbox qemu libvirt-daemon-system - name: Set up VM diff --git a/src/sampler.rs b/src/sampler.rs index db010e6c..10f0cdfa 100644 --- a/src/sampler.rs +++ b/src/sampler.rs @@ -56,7 +56,7 @@ impl Sampler { spy } Err(e) => { - initialized_tx.send(Err(e)).unwrap_err(); + initialized_tx.send(Err(e)).unwrap(); return; } }; @@ -308,7 +308,7 @@ impl PythonSpyThread { } Err(e) => { warn!("Failed to profile python from process {}: {}", pid, e); - initialized_tx.send(Err(e)).unwrap_err(); + initialized_tx.send(Err(e)).unwrap(); return; } };