Comments (7)
Maybe a wording change that does both...
It might be good to move the "Duration" section of the Retry docs to be right below the "Attempts" section, since they both serve the same purpose of constraining executions, as you point out. For proposed wording on "Duration", which would directly follow "Attempts", maybe:
In addition to max attempts, you can also add a max duration for an execution, after which retries will stop if the max attempts haven't already been reached.
Would those two changes clarify things?
from failsafe.
@jhalterman sounds good, I could also image that an example with both maxDuration and maxRetries set to -1 would also make it even clearer
from failsafe.
I just pushed this change and also added a note about disabling retries: failsafe-lib/failsafe.dev@4ae3ec3
from failsafe.
So you want to emphasize that maxDuration
doesn't supersede maxRetries/Attempts
? Would this addition make it clear?
You can add a max duration for an execution, after which retries will stop (if not stopped by other constraints, like
maxRetries/Attempts
).
from failsafe.
Yes exactly I ran into this today wondering why only 3 attempts were taking place, only rereading the duration section I was confused. However, after reading the javadoc of withMaxDuration it dawned on me.
Regarding your proposed wording I still find it missleading as I never specified maxRetries so I would not assume other constraints as I already have specified a stop constraint via duration. So maybe also add a note to your proposal, something along the lines:
You can add a max duration for an execution, after which retries will stop (if not stopped by other constraints, like maxRetries/Attempts, Note: maxRetries is set to 3 if not overridden).
from failsafe.
@jhalterman - Would you want a wording change here, or an earlier emphasis on how maxRetries/Attempts
is always considered, or both?
from failsafe.
@jhalterman much better now, thank you for the quick fix
from failsafe.
Related Issues (20)
- RetryPolicyConfig.getDelayMin returning null when only withDelay() is used HOT 1
- Support accrual failure detection HOT 4
- ExecutionContext#getStartTime() returns Duration HOT 6
- Timeout with retry hangs with Failsafe 2.4.4 HOT 1
- DelegatingScheduler singletons in modern style HOT 9
- FailsafeCall micro refactoring, plus World-Wide Nr.1 duplicated utility method for OkHttp HOT 4
- Feature: micrometer.io metrics integration HOT 3
- FYI: Very compact "lean" version of DelegatingScheduler HOT 1
- handleresultif and fallback with exception -- possible? HOT 6
- where is the logging? HOT 2
- Add FailsafeExecutionException extending FailsafeException for wrapping Throwables in sync get HOT 1
- Make CircuitBreaker delay time mockable for testing HOT 6
- Support Java Modules HOT 1
- Add Failsafe to vertx-awesome HOT 1
- Result futures strongly retain supplying functions
- Why does CheckedPredicate exist? HOT 2
- Bulkhead policy may drop requests when maxWaitTime is specified HOT 8
- Guidance around CheckedPredicate HOT 2
- Time based error limiter policy
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from failsafe.