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

@Retry has time unit attributes with names inconsistent with the main attribute name #524

Open
Ladicek opened this issue Mar 31, 2020 · 2 comments

Comments

@Ladicek
Copy link
Contributor

Ladicek commented Mar 31, 2020

We mostly use a convention that a time unit attribute for some attribute foo is called fooUnit (for example, delay and delayUnit). Perhaps with an exception that if the attribute is called value, then the time unit attribute is just unit.

However, some @Retry attributes don't stick to this convention:

  • maxDuration and durationUnit
  • jitter and jitterDelayUnit

Especially durationUnit might look like perhaps it covers all duration values, and not just maxDuration. This was pointed out by @yoshioterada here: smallrye/smallrye-fault-tolerance#206

I propose we rename durationUnit to maxDurationUnit, and jitterDelayUnit to jitterUnit. We can do it in 2 ways:

  1. Hard breaking change. Just do the rename.
  2. With a deprecation period. For some period of time, both variants would exist, the old one being @Deprecated. If both were used, the new one would have a priority. This should be relatively easy to implement, as there's no collision.
@Emily-Jiang
Copy link
Member

Yes, we discussed this unit renaming before but dismissed the suggestion of renaming the parameters as the names are straightforwad and not worth the effor of breaking backward compatibility. However, I think the 2nd option sounds like a good compromise.

@Ladicek
Copy link
Contributor Author

Ladicek commented Apr 14, 2020

I would agree that "the names are straightforwad", but I received a bug report, so clearly there is some problem :-)

I'll try implementing the 2nd option and see how it looks like.

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

No branches or pull requests

2 participants