Skip to content

Executor is unusable after spawn_many iterator panics #135

@purplesyringa

Description

@purplesyringa

In particular, if the test iterator_panics_mid_run is extended like this:

#[test]
fn iterator_panics_mid_run() {
    let ex = Executor::new();

    let panic = std::panic::catch_unwind(|| {
        let mut handles = vec![];
        ex.spawn_many(
            (0..50).map(|i| if i == 25 { panic!() } else { future::ready(i) }),
            &mut handles,
        )
    });
    assert!(panic.is_err());

    // New code:
    let _ = ex.spawn(future::ready(0));
}

...the call to spawn panics due to a PoisonError while trying to lock active. IMO, the slab allocator should not ever be poisoned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions