Fix: Pool 'db-5c52aaf50617332d2292619e5a36b490.fra.appwrite.center' is empty (size 24, active 0, idle 0)#34
Closed
claudear wants to merge 1 commit into
Closed
Conversation
… Throwable pop() reserves a capacity slot (connectionsCreated++) before creating a connection, then decrements it on failure. The catch only handled \Exception, so a \Throwable that is not an \Exception (e.g. a \TypeError from the init callback) propagated without releasing the reserved slot. Each such failure permanently shrank the pool's usable capacity. Once the leaked count reached `size`, pop() would refuse to create new connections and every request failed with "Pool '...' is empty (size N, active 0, idle 0)" even though nothing was actually in use. Catch \Throwable so the reserved slot is always released, matching the \Throwable handling already used in destroyConnection(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
Fix Confidence: 75/100 |
|
Thanks for contributing! This repository is a read-only mirror; development for this library happens in |
Greptile SummaryFixes pool-capacity leakage when connection creation throws a non-Exception Throwable.
Confidence Score: 5/5The PR appears safe to merge, with the connection slot cleanup correctly extended to non-Exception failures. The changed catch preserves the existing failure path while ensuring the slot reserved before connection creation is decremented for TypeError and other Throwable failures, and the regression test directly validates the repaired accounting. Important Files Changed
Reviews (1): Last reviewed commit: "fix(pools): release reserved slot when c..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves CLOUD-3NVF (sentry).
PR opened automatically by claudear from pushed branch
fix/pool-creation-slot-leak-on-throwable.