Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(retry-on-timeout): Implement retry on timeout when creating new client #3491

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

Closed
MathieuGuillet wants to merge 4 commits into brianc:master from MathieuGuillet:patch-1

Conversation

Copy link

@MathieuGuillet MathieuGuillet commented Jun 17, 2025
edited
Loading

Add new options and instructions to implement retries on timeout when the pool tries to create new client in the pool.

This will avoid to throw an error on the first timeout error if it can be recover in a given time.

Add new options and instructions to implement retry on timeout when the pool tries to create new client in the pool.
This will avoid to throw an error on the first timeout error if it can be recover in a given time.
@MathieuGuillet MathieuGuillet changed the title (削除) Implement retry on timeout when creating new client (削除ここまで) (追記) feat(retry-on-timeout): Implement retry on timeout when creating new client (追記ここまで) Jun 17, 2025
Copy link
Collaborator

charmander commented Jun 17, 2025
edited
Loading

I think library users should be able to achieve this by calling the relevant pool function repeatedly as long as it returns a specific type of error (which might be different types of errors according to different needs). You can write a module for that.

MathieuGuillet reacted with thumbs up emoji

Copy link
Author

I think library users should be able to achieve this by calling the relevant pool function repeatedly as long as it returns a specific type of error (which might be different types of errors according to different needs). You can write a module for that.

I understand your suggestion, but we are using an ORM (TypeORM) and it does not allow to trick that point easily (we have to change the driver to achieve what you suggest).
I believe it would be reasonable for the connection pool to handle retrying failed connections, within a configurable limit, for a predefined set of error types.
I agree that limiting the retries to only timeout errors is too specific/restrictive. I can improve that by exposing a function in the configuration options to check if an error should trigger the retries (like in TypeORM config: toRetry: (err) => boolean)

What do you think @charmander ? Can I re-open this PR and improve the behavior as explained?

slukes reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /