diff --git a/api/src/http.rs b/api/src/http.rs index 67b7cc96177..217e316e14d 100644 --- a/api/src/http.rs +++ b/api/src/http.rs @@ -425,7 +425,10 @@ pub fn start_http_thread( 'wait: loop { match pool.poll(&mut events, None) { Err(e) if e.kind() == std::io::ErrorKind::Interrupted => continue, - Err(e) => return Err(e), + Err(e) => { + error!("http server poll events failed, {}", e); + return Err(e); + } Ok(_) => {} } diff --git a/src/bin/nydusd/api_server_glue.rs b/src/bin/nydusd/api_server_glue.rs index 29ba7302680..21599697654 100644 --- a/src/bin/nydusd/api_server_glue.rs +++ b/src/bin/nydusd/api_server_glue.rs @@ -321,9 +321,15 @@ impl ApiSeverSubscriber { } = self; let mut events = Events::with_capacity(100); 'wait: loop { - poll.poll(&mut events, None).unwrap_or_else(|e| { - error!("API server poll events failed, {}", e); - }); + match poll.poll(&mut events, None) { + Err(e) if e.kind() == std::io::ErrorKind::Interrupted => continue, + Err(e) => { + error!("API server poll events failed, {}", e); + return; + } + Ok(_) => {} + } + for event in &events { match event.token() { API_WAKE_TOKEN => {