-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add retry to test connections #23757
Add retry to test connections #23757
Conversation
…it parallel calls to datasource.getConnection()
run beam_performanceTests_jdbc |
Run Java JdbcIO Performance Test |
1 similar comment
Run Java JdbcIO Performance Test |
Run Java JdbcIO Performance Test |
Run Java JdbcIO Performance Test |
1 similar comment
Run Java JdbcIO Performance Test |
Put a retry into the DatabaseTestHelper
Run Java JdbcIO Performance Test |
3 similar comments
Run Java JdbcIO Performance Test |
Run Java JdbcIO Performance Test |
Run Java JdbcIO Performance Test |
r: @Abacn |
Assigning reviewers. If you would like to opt out of this review, comment R: @robertwb for label java. Available commands:
The PR bot will only process comments in the main thread (not review comments). |
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control |
I see,the cause is that the test did not retry create table. Can we utilize the backoff pattern to here?
|
Codecov Report
@@ Coverage Diff @@
## master #23757 +/- ##
==========================================
- Coverage 73.24% 73.19% -0.06%
==========================================
Files 719 720 +1
Lines 95955 96069 +114
==========================================
+ Hits 70279 70313 +34
- Misses 24364 24444 +80
Partials 1312 1312
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Run Java JdbcIO Performance Test |
Seems like org.postgresql.util.PSQLException is not caught by the catch (SQLException) https://ci-beam.apache.org/job/beam_PerformanceTests_JDBC/7101/console however PSQLException extends SQLException. Not sure why |
The try-with-resource statement does not catch the exception thrown in the parenthesis, I think. Replace to the simple try { getConnection } would work. |
it appears that it should catch the exception: https://stackoverflow.com/questions/15895227/try-with-resources-must-i-throw-or-catch-the-close-methods-exceptions |
try (Statement statement = connection.createStatement()) { | ||
statement.execute(String.format("create table %s (%s)", tableName, fieldsList)); | ||
return; | ||
} | ||
} catch (SQLException e) { | ||
exception = e; | ||
} finally { | ||
if (connection!=null){ | ||
connection.close(); |
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.
Probably it is closing the connection caused issue. dataSource owns a connection pool and manage the connections. Closing it pre-maturely may have caused racing conditions.
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 looks like it is happening in .getConnection based on the stacktrace
Run Java Precommit |
Run Java PreCommit |
@Abacn can you take another look at this? |
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.
LGTM
fixes #22299
Please add a meaningful description for your change here
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username
).addresses #123
), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>
instead.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI.