Skip to content

Handling safe pool termination on nimble pool #49

@oliveigah

Description

@oliveigah

Although #48 may allow clients to implement safe termination using the proposed callback, I thought it might be worth raising the idea of handling safe pool termination automatically inside NimblePool.

The reason I bring this up is that automatic idle pool termination is already a built-in feature via the handle_ping/2 callback. However, if clients rely on this feature, they currently need to either handle safe termination themselves or risk facing a race condition that could lead to unwanted raises.

This situation makes me wonder if it wouldn't be better to address the problem directly where it originates (inside NimblePool’s idle termination logic). Because I feel like whenever I use the idle termination feature I must implement safe termination too, so it feels like it really should be built together!

I don’t have a clear proposal for how this could be achieved yet, just wanted to start the discussion!

I completely understand you prefer to keep NimblePool minimal and leave flexibility to users, so if you feel this isn’t worth the extra complexity, feel free to close the issue — no hard feelings at all, haha! 😄

Thanks again for all the guidance and support on this!

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