GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||
GeezerVison is showing github.com — Refine delay jitter for exponential backoff by YuriyHolinko · Pull Request #7206 · open-telemetry/opentelemetry-java Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@ ## main #7206 +/- ## ========================================= Coverage 89.93% 89.93% - Complexity 6676 6678 +2 ========================================= Files 750 750 Lines 20168 20176 +8 Branches 1978 1978 ========================================= + Hits 18138 18146 +8 Misses 1435 1435 Partials 595 595 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Is this fixing the problem discussed in #7004? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
yeah, looks like it's the same issue |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The new logic for computing backoff looks good. Just wondering why touch the other logic, which needs to be pretty carefully considered.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| long currentBackoffNanos = | ||
| Math.min(nextBackoffNanos, retryPolicy.getMaxBackoff().toNanos()); | ||
| long backoffNanos = (long) (randomJitter.get() * currentBackoffNanos); | ||
| nextBackoffNanos = (long) (currentBackoffNanos * retryPolicy.getBackoffMultiplier()); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Should also update the implementation in JdkHttpSender.
I know its not ideal that there are two implementations.. Maybe worth adding a utility function to RetryPolicy that computes the backoff for a given attempt N. Signature might look like:
public long computeBackoffNanosForAttempt(int attempt, Random randomSource) {...}
It wouldn't be as efficient as the current implementation, but...
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Added code for JdkHttpSender
I did not consider adding that method to calculate a backoff delay time
looking at the code I would say we can build more abstractions for sending requests and checking responses and exceptions, but not sure it's really helpful so let's probably move on with duplicated approach as we had before
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| attempt++; | ||
| try { | ||
| response = chain.proceed(chain.request()); | ||
| if (response != null) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
What's the motivation for changing this part of the logic?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
if response is null and no exception happened, the code fails in throw exception; line because exception is null. when response is null it's not something transient
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I suppose this is possible but I haven't seen response null in practice. If it does occur, we can simply add a null check immediately after response = chain.proceed(chain.request()).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
it's exactly what I did in this PR 😃
also null check was before this change so I intentionally keep it (but I suspect I can just drop it)
also previous code has the issue - if previous(before last) attempt returned rertryable response but the last attempt gets retryable exception method still returns the previous response which is not good as the last state (exception) should be returned
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
I replied in threads, tell me please if there are still any unanswered questions |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.