Skip to content
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

Merged
merged 3 commits into from
Nov 20, 2024

Conversation

mikaylathompson
Copy link
Collaborator

@mikaylathompson mikaylathompson commented Nov 19, 2024

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

  • New functionality includes testing
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

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.

@@ -59,6 +59,8 @@ private void setupShardWorkItems(
Duration.ofMinutes(5),
context::createWorkAcquisitionContext
);
} catch (InterruptedException e) {
throw e;
Copy link
Collaborator Author

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));
Copy link
Collaborator Author

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;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link

codecov bot commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.72%. Comparing base (176eefd) to head (233eaf8).
Report is 2 commits behind head on main.

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              
Flag Coverage Δ
unittests 80.72% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@peternied peternied merged commit 1db3785 into opensearch-project:main Nov 20, 2024
17 checks passed
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