Comments (7)
@leozilla Just pushed a fix for this. This issue has to do with performing an execution on via .future
specifically where the resulting CompletableFuture
cancellation was not propagated to the associated FailsafeFuture
which would stop continued execution. Maybe you can give this a try and let me know if it resolves your problem. I pushed a test case here:
from failsafe.
Ah, thanks!
I did not expect this to be a bug otherwise I would have tried to fix it myself.
Anyway I try your fix now and let you know how it worked out.
from failsafe.
You should be able to just pull master and mvn package
to give it a try. Tnx.
from failsafe.
Going to close this now ahead of the next release. @leozilla if the fix ends up not looking good on your end, feel free to re-open.
from failsafe.
Released 0.9.3 with this fix.
from failsafe.
Sorry for the delay, it works for me.
Just one more minor thing.
The test ExecutionTest#shouldSupportMaxDuration()
breaks randomly on windows with oracle jdk 1.8.0_91
Reason seems to be the Thread.sleep is exactly as long as the max duration.
Fails
public void shouldSupportMaxDuration() throws Exception {
Execution exec = new Execution(new RetryPolicy().withMaxDuration(100, TimeUnit.MILLISECONDS));
assertTrue(exec.canRetryOn(e));
assertTrue(exec.canRetryOn(e));
Thread.sleep(100); // <--
assertFalse(exec.canRetryOn(e));
assertTrue(exec.isComplete());
}
Succeeds (although still a little ugly)
public void shouldSupportMaxDuration() throws Exception {
Execution exec = new Execution(new RetryPolicy().withMaxDuration(100, TimeUnit.MILLISECONDS));
assertTrue(exec.canRetryOn(e));
assertTrue(exec.canRetryOn(e));
Thread.sleep(105); // <--
assertFalse(exec.canRetryOn(e));
assertTrue(exec.isComplete());
}
Should I provide a fix/PR for it?
from failsafe.
Yea, that would be a good change. PR welcome :)
from failsafe.
Related Issues (20)
- Why does CheckedPredicate exist? HOT 2
- Also add note about default maxRetries of 3 to maxDuration section of the documentation HOT 7
- Bulkhead policy may drop requests when maxWaitTime is specified HOT 8
- Guidance around CheckedPredicate HOT 2
- Time based error limiter policy
- [Question]Can withBackoff and withDelay be used at the same time? HOT 2
- RetryPolicy handleIf not working with DynamoDbException in predicate HOT 4
- Having a context object in the run(...) and get(...) methods HOT 7
- dev.failsafe.Functions.* do not propagate toString to the wrapped object
- [Question] Is it possible to have multiple Fallback policies in one Failsafe executor? HOT 4
- [question] how to use failsafe with kotlin
- Feature Request: Integrate / add support for Lunar Proxy (backend policy) HOT 1
- Why recommend CircuitBreaker before Retry? HOT 1
- CircuitBreaker stays in OPEN even after DELAY time HOT 1
- Nested retries, how to prevent duplicate retrying? HOT 5
- FailsafeExecutor.compose and .with(Executor) have surprising composition behavior
- Provide BOM with all failsafe artifacts for better dependency management
- Failsafe okhttp integration causes issues with BearerAuth and outdated tokens
- CircuitBreakerBuilder withSuccessThreshold documentation whoopsy HOT 1
- [Question] Is it possible to override the "maxRetries" and "delay" of retry policy at runtime? HOT 2
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.