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 support for the maxWaitTimeoutIfPoolExhausted pool option (available in @sap/hana-client version 2.27 or later) and maps the deprecated requestTimeout from the old hdb-pool library to this option.
Pull-Request Checklist
Code is up-to-date with the v0.3 branch
This pull request links relevant issues as Fixes #00000
There are new or updated tests validating the change (tests/**.test.ts)
Documentation has been updated to reflect this change (docs/docs/**.md)
The fallback from maxWaitTimeoutIfPoolExhausted to requestTimeout may cause issues if requestTimeout is undefined or if users have both options set. Consider whether the deprecated option should take precedence or if there should be a warning when both are specified.
The Docker image update and command reordering appear unrelated to the PR's stated purpose of adding pool timeout support. This change should be verified as intentional or moved to a separate PR.
-maxWaitTimeoutIfPoolExhausted:- this.options.pool?.maxWaitTimeoutIfPoolExhausted ??- this.options.pool?.requestTimeout ??- 0,+maxWaitTimeoutIfPoolExhausted: (() => {+ const timeout = this.options.pool?.maxWaitTimeoutIfPoolExhausted ??+ this.options.pool?.requestTimeout ??+ 0;+ if (timeout < 0) {+ throw new TypeORMError(+ "maxWaitTimeoutIfPoolExhausted must be a non-negative number"+ );+ }+ return timeout;+})(),
Apply / Chat
Suggestion importance[1-10]: 5
__
Why: The suggestion correctly points out that a timeout value should not be negative. Adding this validation improves the driver's robustness by catching configuration errors early.
Why: The suggestion correctly identifies that a negative timeout value is invalid and could cause issues. Applying Math.max(0, ...) is a simple and effective way to sanitize the user-provided configuration and improve the driver's robustness.
For setting maxWaitTimeoutIfPoolExhausted, replace the nullish coalescing operator (??) with a more explicit ternary operator checking for undefined to improve clarity when falling back to the deprecated requestTimeout.
Why: The suggestion correctly notes that the existing code with the nullish coalescing operator (??) works as intended, but proposes a more verbose ternary operator for readability, which is a subjective style preference with no functional benefit.
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.
Description of change
Fixes #11619.
Adds support for the
maxWaitTimeoutIfPoolExhaustedpool option (available in@sap/hana-clientversion2.27or later) and maps the deprecatedrequestTimeoutfrom the oldhdb-poollibrary to this option.Pull-Request Checklist
v0.3branchFixes #00000tests/**.test.ts)docs/docs/**.md)