You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds the optional sessionPoolMaxSize client setting. The default remains unlimited for backward compatibility; a positive value caps the number of idle, busy, and in-progress session creations owned by that client.
Capacity is reserved before CreateSession, released on both success and failure, and exhaustion is reported as ClientResourceExhaustedException. Session pools are now client-scoped instead of process-wide static state so limits and sessions do not leak across separate Ydb clients.
Test concurrent CreateSession capacity consumption
tests/SessionPoolSizeLimitTest.php:106
This test only attempts the second creation after the first request and reservation have completed, so it does not verify the new requirement that an in-progress CreateSession consumes capacity. The suite would still pass if $reservedSlots were removed from the capacity calculation. Add a re-entrant or otherwise paused CreateSession test that attempts another creation while the first request is outstanding and asserts ClientResourceExhaustedException.
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🔵 Needs a closer look
Configuration validation currently accepts integral floating-point values despite requiring a positive integer.
Review effort: Balanced Findings: None
Previously missed (1)
In code that hasn't changed since last review
Reject integral floats for positive integer validation
src/Ydb.php:274
FILTER_VALIDATE_INT converts an integral float such as 1.0 to integer 1, so this accepts a value that the documented “positive integer” contract—and MemorySessionPool's constructor—rejects. Explicitly reject floats before filtering (while retaining numeric-string support if intended).
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🔵 Needs a closer look
Custom pools lacking the optional capacity contract silently bypass the configured client limit.
Review effort: Balanced Findings: None
Previously missed (1)
In code that hasn't changed since last review
Custom pools bypass configured session pool limits
src/Table.php:173
A configured limit is silently bypassed for every existing custom SessionPoolContract that does not implement the new optional capacity contract: both capacityPool and reservation remain null, so repeated createSession() calls can add unlimited sessions despite sessionPoolMaxSize. This contradicts the client-level limit exposed by the setting. Please enforce capacity independently of the pool, or reject an incompatible custom pool when a finite limit is configured.
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
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.
Closes #209.
Adds the optional
sessionPoolMaxSizeclient setting. The default remains unlimited for backward compatibility; a positive value caps the number of idle, busy, and in-progress session creations owned by that client.Capacity is reserved before
CreateSession, released on both success and failure, and exhaustion is reported asClientResourceExhaustedException. Session pools are now client-scoped instead of process-wide static state so limits and sessions do not leak across separateYdbclients.