Merge branch 'master' into feat/server_max_blocking_threads

This commit is contained in:
fakeshadow 2021-02-04 03:35:50 -08:00 committed by GitHub
commit 7f9394734a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -2,9 +2,11 @@
## Unreleased - 2021-xx-xx ## Unreleased - 2021-xx-xx
* Hidden `ServerBuilder::start` method has been removed. Use `ServerBuilder::run`. [#246] * Hidden `ServerBuilder::start` method has been removed. Use `ServerBuilder::run`. [#246]
* Add retry for EINTR(`io::Interrupted`) in `Accept`'s poll loop. [#264]
* Add `ServerBuilder::worker_max_blocking_threads` for customize blocking thread pool. [#265] * Add `ServerBuilder::worker_max_blocking_threads` for customize blocking thread pool. [#265]
[#246]: https://github.com/actix/actix-net/pull/246 [#246]: https://github.com/actix/actix-net/pull/246
[#264]: https://github.com/actix/actix-net/pull/264
[#265]: https://github.com/actix/actix-net/pull/265 [#265]: https://github.com/actix/actix-net/pull/265

View File

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