1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-26 19:47:43 +02:00

prevent arbiter leaks by waiting for registration

This commit is contained in:
Rob Ede
2021-01-31 04:41:28 +00:00
parent b75254403a
commit 2fa60b07ae
5 changed files with 62 additions and 34 deletions

View File

@ -215,7 +215,7 @@ impl ServerWorker {
}
Err(e) => {
error!("Can not start worker: {:?}", e);
Arbiter::handle().stop();
Arbiter::current().stop();
}
}
wrk.await
@ -386,7 +386,7 @@ impl Future for ServerWorker {
let num = num_connections();
if num == 0 {
let _ = tx.take().unwrap().send(true);
Arbiter::handle().stop();
Arbiter::current().stop();
return Poll::Ready(());
}
@ -394,7 +394,7 @@ impl Future for ServerWorker {
if Pin::new(t2).poll(cx).is_ready() {
let _ = tx.take().unwrap().send(false);
self.shutdown(true);
Arbiter::handle().stop();
Arbiter::current().stop();
return Poll::Ready(());
}