question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Naming/Javadoc suggestions for Retry.java

See original GitHub issue

Documentation Issue

I think that both the naming and the javadoc regarding number of retries in Retry.java could use some changes for clarity.

  • Naming. totalRetries is great, but totalRetriesInARow is, IMHO, if not confusing then not greatly named. My suggestion is to deprecate it and change to consecutiveRetries.
  • I think the javadoc part ZERO BASED... should be omitted. The gist of can also be read as... is perfectly sufficient, keep it simple and the word retries (“re” being the key) cannot mean anything else. Also, a 0-index for the error... is potentially misleading given the error - I first read it as a count of errors with a specific kind of Throwable, as if there were parallell counts (one per Throwable-type or something like that) going on.

Improvement Suggestion

My suggestions for the javadoc of those methods:

Returns: the total number of retries since the source first was subscribed to.

and

Returns: the number of retries since the latest onNext(), or since the source first was subscribed to if there hasn't been any onNext() signals (in which case totalRetries() and consecutiveRetries() are equivalent).

Also I suggest that both the parts that might result in a retry attempt and that potentially triggers a retry (in generateCompanion() and RetrySignal) be removed. I understand them, but I think it can be misleading, it might be interpreted as if the signals themselves would trigger retries given state x or y. It should be clear that the signal-flux is just a provider of signals/metadata and that it’s up to the companion to react to it and decide if there should be any retries or not (even if one decides to return the flux itself, but that’s probably not the most common use-case).

Happy to submit a PR if you like any of it.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
simonbaslecommented, Feb 11, 2021

All good, easy enough 😄

1reaction
simonbaslecommented, Jan 28, 2021

hi @mickeelm. At the time I tried to come up with a meaningful name, always a hard endeavor… the name has to stay for at least a while though, now that it has been (recently) released and part of the public API. we can definitely rework the javadoc and a PR with your suggestions would be very welcome there.

Keep in mind RetrySignal was added in 3.3.x so use that branch as the basis for your PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Write Doc Comments for the Javadoc Tool - Oracle
This document describes the style guide, tag and image conventions we use in documentation comments for Java programs written at Java Software, ...
Read more >
How to JavaDoc (efficient and maintainable) - 6 steps
When coding Java Beans and Entity beans, my big pet peeve is that I document (and annotate) the private fields, and there is...
Read more >
how to add javaDoc to my Java code in a NetBeans based ...
try this in NetBeans IDE. Choose Tools > Java Platform Manager from the main window. Select the platform to which you want to...
Read more >
ClientConfiguration (AWS SDK for Java - 1.12.362)
Default request retry policy, including the maximum retry count of 3, the default retry ... checks the value of the Java system property...
Read more >
Retry (resilience4j-retry 0.15.0 API) - javadoc.io
String name, java.util.function.Supplier<RetryConfig> retryConfigSupplier). Creates a Retry with a custom Retry configuration. Parameters: name - the ID of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found