dashbitco / dashbitco/nimble_pool

Handling safe pool termination on nimble pool

Open
#49 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Elixir
Stars
390
Forks
29
Avg merge
1h 12m
Merged PRs (30d)
1

Description

Although https://github.com/dashbitco/nimble_pool/issues/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!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading issue #48 and the existing handle_ping/2 idle-termination behavior in NimblePool. Determine whether safe termination belongs inside NimblePool or remains a client responsibility, then document a concrete proposal, its race-condition behavior, and what tests would demonstrate safe termination.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.