Skip to content

Unwind safety #139

@dchenk

Description

@dchenk

Would it be feasible or even make sense to implement UnwindSafe for the managed::Pool type?

Some context: I've decided to replace r2d2 with deadpool-diesel for database connection pooling in an application because r2d2 has a serious flaw in the way it handles panics (see diesel-rs/diesel#2124, diesel-rs/diesel#2105, diesel-rs/diesel#2020, sfackler/r2d2#70).

The managed::Pool type not being UnwindSafe prevents certain use cases such as passing the pool to an async function that may panic but where the panic needs to be caught. As far as I can tell, because pooled objects are wrapped in a Mutex and deadpool discards poisoned mutexes, there's no risk of reusing an invalid pooled object. (At least this is the case with the diesel and sqlite implementations.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-coreArea: Core / deadpoolenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions