diff --git a/actix-server/CHANGES.md b/actix-server/CHANGES.md index 70728064..ca3512a4 100644 --- a/actix-server/CHANGES.md +++ b/actix-server/CHANGES.md @@ -2,6 +2,7 @@ ## Unreleased - 2021-xx-xx * Hidden `ServerBuilder::start` method has been removed. Use `ServerBuilder::run`. [#246] +* Add retry for EINTR(`io::Interrupted`) in `Accept`'s poll loop. [#246]: https://github.com/actix/actix-net/pull/246 diff --git a/actix-server/src/accept.rs b/actix-server/src/accept.rs index 89f957a1..c8c1da47 100644 --- a/actix-server/src/accept.rs +++ b/actix-server/src/accept.rs @@ -162,10 +162,13 @@ impl Accept { loop { if let Err(e) = self.poll.poll(&mut events, None) { - if matches!(e.kind(), std::io::ErrorKind::Interrupted) { - continue; - } else { - panic!("Poll error: {}", e); + match e.kind() { + std::io::ErrorKind::Interrupted => { + continue; + } + _ => { + panic!("Poll error: {}", e); + } } }