diff --git a/libs/vm_monitor/src/runner.rs b/libs/vm_monitor/src/runner.rs index 09863c8936..b0ee5f0310 100644 --- a/libs/vm_monitor/src/runner.rs +++ b/libs/vm_monitor/src/runner.rs @@ -4,9 +4,9 @@ //! This is the "Monitor" part of the monitor binary and is the main entrypoint for //! all functionality. +use std::fmt::Debug; use std::sync::Arc; use std::time::{Duration, Instant}; -use std::{fmt::Debug, mem}; use anyhow::{bail, Context}; use axum::extract::ws::{Message, WebSocket}; @@ -141,14 +141,6 @@ impl Runner { ); state.cgroup = Some(cgroup); - } else { - // *NOTE*: We need to forget the sender so that its drop impl does not get ran. - // This allows us to poll it in `Monitor::run` regardless of whether we - // are managing a cgroup or not. If we don't forget it, all receives will - // immediately return an error because the sender is droped and it will - // claim all select! statements, effectively turning `Monitor::run` into - // `loop { fail to receive }`. - mem::forget(requesting_send); } let mut file_cache_reserved_bytes = 0; @@ -417,7 +409,7 @@ impl Runner { } } // we need to propagate an upscale request - request = self.dispatcher.request_upscale_events.recv() => { + request = self.dispatcher.request_upscale_events.recv(), if self.cgroup.is_some() => { if request.is_none() { bail!("failed to listen for upscale event from cgroup") }