Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nydusd: handle api server mio poll error #371

Merged
merged 1 commit into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
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: 4 additions & 1 deletion api/src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(_) => {}
}

Expand Down
12 changes: 9 additions & 3 deletions src/bin/nydusd/api_server_glue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down