-
Notifications
You must be signed in to change notification settings - Fork 30
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
Sonarqube fixes from subshard work coordination #1151
Sonarqube fixes from subshard work coordination #1151
Conversation
Signed-off-by: Mikayla Thompson <[email protected]>
@@ -59,6 +59,8 @@ private void setupShardWorkItems( | |||
Duration.ofMinutes(5), | |||
context::createWorkAcquisitionContext | |||
); | |||
} catch (InterruptedException e) { | |||
throw e; |
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.
} catch (Exception e) { | ||
attempt++; | ||
if (attempt > maxRetries) { | ||
exceptionConsumer.accept(e); | ||
throw new RetriesExceededException(e, attempt); | ||
} | ||
Duration sleepDuration = Duration.ofMillis((long) (Math.pow(2.0, attempt - 1) * baseRetryTimeMs)); | ||
Duration sleepDuration = Duration.ofMillis((long) (Math.pow(2.0, attempt - 1.0) * baseRetryTimeMs)); |
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.
@@ -161,13 +161,15 @@ private static void retryWithExponentialBackoff( | |||
Exception underlyingException = (Exception) e.getCause(); | |||
exceptionConsumer.accept(underlyingException); | |||
throw new IllegalStateException(underlyingException); | |||
} catch (InterruptedException e) { | |||
throw e; |
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.
Signed-off-by: Mikayla Thompson <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1151 +/- ##
============================================
- Coverage 80.75% 80.72% -0.04%
+ Complexity 2953 2952 -1
============================================
Files 399 399
Lines 15101 15106 +5
Branches 1021 1021
============================================
- Hits 12195 12194 -1
- Misses 2292 2298 +6
Partials 614 614
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Description
Sonarqube had a few complaints about details of the sub-shard work coordination implementation. Quick fixes in this PR.
Issues Resolved
n/a individual issues linked in comments
Testing
n/a
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.