-
Notifications
You must be signed in to change notification settings - Fork 666
Open
Labels
C-bugCategory: bugCategory: bug
Description
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
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
ufoscout and let4be
Metadata
Metadata
Assignees
Labels
C-bugCategory: bugCategory: bug