Skip to content
Draft
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
5 changes: 2 additions & 3 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,11 @@ impl KrunContext {
/// Spawn a thread to listen for shutdown requests and run the workload. If behaving properly,
/// the main thread will never return from this function.
pub fn run(&self) -> Result<(), anyhow::Error> {
// Get the krun shutdown file descriptor and listen to shutdown requests on a new thread.
let shutdown_eventfd = unsafe { get_shutdown_eventfd(self.id) };
let uri = self.args.restful_uri.clone();

// Only spawn a listener thread if the user specified unix:// or tcp://
// Only create a shutdown eventfd and listener for unix:// or tcp:// endpoints.
if uri.as_ref().is_some_and(|u| *u != RestfulUri::None) {
let shutdown_eventfd = unsafe { get_shutdown_eventfd(self.id) };
thread::spawn(move || status_listener(shutdown_eventfd, uri).unwrap());
}

Expand Down