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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade hasql-pool #2391
Upgrade hasql-pool #2391
Changes from all commits
4b24599
bcb9a1d
022e7ca
c892a4e
057e326
b589495
67cbe5b
fcb3e5b
e3726b0
2f9c60e
1623591
72f61ab
84f4b4a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one issue with the way we replace pools, in that there's a timespan where two pools are around (the old one with the in-process requests, and the new empty one). Until all the old requests are done, it's possible to exceed the configured pool size.
I tend feel it's ok to accept this while fixing the issue this addresses otherwise, and keep it in mind as something to be fixed down the line, but I can't really judge that.
To address this properly would have to happen in the pooling library. (Since
hasql-pool
is pretty small and I'm a bit doubtful of getting our changes upstreamed anytime soon, I'd probably inlineHasql.Pool
, fix this for us, and file PRs upstream independently.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've implemented this as a patch to
hasql-pool
here nikita-volkov/hasql-pool#16.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be clear, does nikita-volkov/hasql-pool#16 prevent exceeding the configured pool size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes (well unless there's a bug in the PR).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible for the user to get this error? AIUI, on
usePool
we try to recover fromPoolIsReleasedUsageError
immediately.If it's possible, perhaps this momentary error should include a "Retrying.." message and a
503
status to clarify it's temporary.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not expected to be visible to the user except during shutdown, so not temporary in that sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. In that case maybe we should a have more user-facing error message, like: