From 572de288f0e003256e1cc9496205f6338434caf1 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Fri, 21 Aug 2020 11:43:25 +0100 Subject: [PATCH] sandbox: Remove unnecessary thread Don't create a thread to wait for the ttRPC server to end - it isn't required as the operation should be blocked on. Signed-off-by: James O. D. Hunt --- src/agent/src/main.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/agent/src/main.rs b/src/agent/src/main.rs index 8ffb68f87..c124dfa5b 100644 --- a/src/agent/src/main.rs +++ b/src/agent/src/main.rs @@ -246,17 +246,9 @@ fn start_sandbox(logger: &Logger, config: &agentConfig) -> Result<()> { //vsock:///dev/vsock, port let mut server = rpc::start(sandbox.clone(), VSOCK_ADDR, VSOCK_PORT); - let handle = thread::spawn(move || { - // info!("Press ENTER to exit..."); - // let _ = io::stdin().read(&mut [0]).unwrap(); - // thread::sleep(Duration::from_secs(3000)); - - let _ = rx.recv().unwrap(); - }); - let _ = server.start().unwrap(); - handle.join().unwrap(); + let _ = rx.recv().map_err(|e| format!("{:?}", e)); server.shutdown();