Skip to content

Commit a79d1e3

Browse files
committed
Retry JdbcClient::execute method
So far we were doing a retry only when the connection opening had intermittent failure. Notice this is a best effort retrying. There is another execute method in BaseJdbcClient, however it is not a trivial thing to retry on statement execution there as it is not safe to retry it without opening a new connection.
1 parent e6f2750 commit a79d1e3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/RetryingJdbcClient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ public Connection getConnection(ConnectorSession session, JdbcSplit split, JdbcP
205205
@Override
206206
public void execute(ConnectorSession session, String query)
207207
{
208-
delegate.execute(session, query);
208+
// we do a nested retry as opening a connection is already retried, however it is better to retry on intermittent issue than fail
209+
retry(policy, () -> delegate.execute(session, query));
209210
}
210211

211212
@Override

0 commit comments

Comments
 (0)