Skip to content
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

RD-12419: Added retry to SqlConnectionPool #498

Conversation

bgaidioz
Copy link
Collaborator

An implementation of a connection retry to the SqlConnectionPool.

The patch adds a connectAnd API that obtains a connection and passes to the provided handler:

def connectAnd[T](jdbcUrl: String)(handler: Connection => T): T

It handles the connection failures internally.

Calls that would pick a connection and use it are here switched to that. A test is added that purposely triggers connection failures to the FDW database, using a test container network proxy introducing connection errors that last a couple of seconds. With the patch, calls eventually succeed since connectAnd retries and sleeps enough to recover.

One call hasn't been fixed: execute, because it is provided with an OutputStream to write to, and if it would retry in the middle of its execution, that would lead to a corrupted output.

@bgaidioz bgaidioz force-pushed the RD-12419-sql-compiler-service-doesnt-retry-upon-failures-e-g-fdw-crashes branch from 5a6366c to 7eb4b0c Compare August 27, 2024 15:47
@bgaidioz bgaidioz closed this Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant