-
Notifications
You must be signed in to change notification settings - Fork 20
Conversation
730ca92
to
5a1a4a5
Compare
Codecov Report
@@ Coverage Diff @@
## master #323 +/- ##
============================================
- Coverage 67.15% 66.88% -0.28%
+ Complexity 2034 2033 -1
============================================
Files 297 297
Lines 13063 13095 +32
Branches 1081 1086 +5
============================================
- Hits 8773 8759 -14
- Misses 3910 3954 +44
- Partials 380 382 +2
Continue to review full report at Codecov.
|
5a1a4a5
to
02726fa
Compare
...com/amazon/opendistro/elasticsearch/performanceanalyzer/rca/persistence/SQLitePersistor.java
Outdated
Show resolved
Hide resolved
...java/com/amazon/opendistro/elasticsearch/performanceanalyzer/rca/persistence/FileRotate.java
Outdated
Show resolved
Hide resolved
try { | ||
LOG.debug("Trying to create a summary table: {} that references {}", tableName, referenceTableName); | ||
Table referenceTable = DSL.table(referenceTableName); | ||
CreateTableConstraintStep constraintStep = create.createTable(tableName) |
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.
I assume creating the SQL statement itself does not throw any exception. Can we leave this part out of the try block ?
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.
The DSLContext can be uninitialized if we are not using synchronization between the threads. I saw a case where the table was added to hastable but the columns for the table were missing. We gather some date to create the createStatement and it the gathering part we can run into exceptions.
These cases are fixed now but it would be good to catch and log exception. But you are right, the scope of exceptions is larger and so I have added code to catch exception and not just DataAcessException.
...com/amazon/opendistro/elasticsearch/performanceanalyzer/rca/persistence/SQLitePersistor.java
Outdated
Show resolved
Hide resolved
…rror catching Added a test that does concurrent writes to the DB
65a9c4d
to
ed3410c
Compare
Issue #: #324
Description of changes:
This change makes us print less stacktrace on errors that are expected. Also resolves a concurrency bug while threads doing writes and while the file is being rotated.
Tests:
Added a test
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.