Multi-arbiter systems leave lingering Arbiters behind after shutdown.
Author: matkladCreated Feb 15, 2021Updated Feb 22, 2021
LabelsC-bug
Expected Behavior
After System::run returns, all system's actors are stopped and dropped, all Arbiters are joined.
Current Behavior
If, inside the system, additional arbiters are created, they outlive the system.
Reproducible example:
#[test]
fn actix_sample() {
System::run(|| {
let arb = actix::Arbiter::new();
A::start_in_arbiter(&arb, |_| A);
std::thread::sleep_ms(100);
System::current().stop();
});
eprintln!("B");
std::thread::sleep_ms(300);
}
struct A;
impl Drop for A {
fn drop(&mut self) {
std::thread::sleep_ms(200);
println!("A");
}
}
impl actix::Actor for A {
type Context = actix::Context<A>;
}This prints B, A while it should print A, B. Otherwise, it's not really defined when the actor get's dropped and it might happen after main exits, skipping drops
Context
https://github.com/near/nearcore/issues/3925
Your Environment
- Rust Version (I.e, output of
rustc -V):rustc 1.49.0-nightly (91a79fb29 2020-10-07) - Actix Version:
0.11.0-beta.1
Source: actix/actix