Handle EINTR in server accept loop

This commit is contained in:
Nikolay Kim 2021-02-18 17:59:20 +06:00
parent aefa224542
commit ff33374810
3 changed files with 12 additions and 3 deletions

View file

@ -2,6 +2,8 @@
## [0.2.0-b.12] - 2021-02-18 ## [0.2.0-b.12] - 2021-02-18
* Handle EINTR in server accept loop
* Fix double registation for accept back-pressure * Fix double registation for accept back-pressure
## [0.2.0-b.11] - 2021-02-02 ## [0.2.0-b.11] - 2021-02-02

View file

@ -1,6 +1,6 @@
[package] [package]
name = "ntex" name = "ntex"
version = "0.2.0-b.11" version = "0.2.0-b.12"
authors = ["ntex contributors <team@ntex.rs>"] authors = ["ntex contributors <team@ntex.rs>"]
description = "Framework for composable network services" description = "Framework for composable network services"
readme = "README.md" readme = "README.md"

View file

@ -237,8 +237,15 @@ impl Accept {
let mut events = mio::Events::with_capacity(128); let mut events = mio::Events::with_capacity(128);
loop { loop {
if let Err(err) = self.poll.poll(&mut events, None) { if let Err(e) = self.poll.poll(&mut events, None) {
panic!("Poll error: {}", err); match e.kind() {
std::io::ErrorKind::Interrupted => {
continue;
}
_ => {
panic!("Poll error: {}", e);
}
}
} }
for event in events.iter() { for event in events.iter() {