Skip to content

Conversation

@7yyo
Copy link

@7yyo 7yyo commented Nov 24, 2023

benchmarkSQL throw an exception after any connection close, which will cause quit. Add automatic reconnect with retry to benchmarkSQL, which will automatically reconnect after connection close or tidb-server crash.

@7yyo
Copy link
Author

7yyo commented Nov 24, 2023

@jackysp PTAL

jackysp
jackysp previously approved these changes Nov 24, 2023
throws SQLException
{
dbConn.rollback();
dbConn.rollback();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

格式调一下

}
catch (SQLException | CommunicationException e ){
try {
retryConnect();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有保护全下面还有类似场景

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

判断一下错误原因,如果是关闭再重连

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image 这样处理是不是更好点

@7yyo 7yyo changed the title check conn isClosed before commit or rollback automatic reconnection and retry after connection closed Nov 27, 2023
@7yyo 7yyo changed the title automatic reconnection and retry after connection closed automatic reconnect with retry after connection closed Nov 27, 2023
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.

3 participants