-
Notifications
You must be signed in to change notification settings - Fork 562
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
Implementation of MP FT 2.1.1 using FT SE #2348
Conversation
…nous. Passing unit tests FallbackTest, RetryTest and AsynchronousTest. Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
…fied ErrorChecker to use subtyping instead of equality when comparing exceptions. Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
…T annotations. Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
- Support for sync (no queues) in Bulkhead - Fixed validation in FallbackAntn - Fixes to CommandRunner async support - Some changes in unit tests while preserving coverage All unit tests for Timeout, Fallback, Retry, Asynchronous, Bulkhead and CircuitBreaker are passing. Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
- Support for metrics for all primitives except bulkheads - Changes to SE Retry to count number of retries - Some test fixes Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
- New method in Bulkhead to return stats - Support for all metrics related to bulkheads - Some minor test changes Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
…CKs, only the CDI request scope is active. Temporarily disable annotation validation in CDI extension as this now causes TCKs to fail validation before running. Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
…n and then applyOn sets. Updates to some tests. Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
…tionStage<?>. Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
- Handle timeouts when a method catches InterruptedException - Changes to SE FT to support some event listeners - Create handlers for each invocation while sharing those for Bulkheads and CircuitBreakers - Renamed CommandRunner to MethodInvoker Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
CompletableFuture<T> future = new CompletableFuture<>(); | ||
AsyncTask<T> task = new AsyncTask<>(supplier, future); | ||
|
||
Future<?> taskFuture; | ||
try { | ||
executor.get().submit(task); | ||
taskFuture = executor.get().submit(task); | ||
} catch (Throwable e) { | ||
// rejected execution and other executor related issues | ||
return Single.error(e); | ||
} | ||
|
||
return Single.create(future); | ||
Single<T> single = Single.create(future, true); | ||
single.onCancel(() -> taskFuture.cancel(false)); // cancel task | ||
return single; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like duplication of CompletableFuture.supplyAsync
internals, is there some AsyncTask
's feature I missed @tomas-langer, or we can simplify?
public <T> Single<T> invoke(Supplier<T> supplier) {
try {
return Single.create(CompletableFuture.supplyAsync(task, executor.get()), true);
} catch (Throwable e) {
// rejected execution and other executor related issues
return Single.error(e);
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, but not sure it is more readable tbh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code has changed now, see below
fault-tolerance/src/main/java/io/helidon/faulttolerance/ErrorChecker.java
Outdated
Show resolved
Hide resolved
fault-tolerance/src/main/java/io/helidon/faulttolerance/AsyncImpl.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
fault-tolerance/src/main/java/io/helidon/faulttolerance/ErrorChecker.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
...rofile/fault-tolerance/src/test/java/io/helidon/microprofile/faulttolerance/TimeoutTest.java
Show resolved
Hide resolved
...-tolerance/src/main/java/io/helidon/microprofile/faulttolerance/FaultToleranceExtension.java
Show resolved
Hide resolved
StringBuilder sb = new StringBuilder(); | ||
for (int i = validFts.size() - 1; i >= 0; i--) { | ||
sb.append(validFts.get(i).toString()); | ||
sb.append("\n"); | ||
} | ||
return sb.toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validFts
is always LinkedList, using descendingIterator
would be nice
Replacing FailSafe and Hystrix by our own implementation of FT primitives. Some minor changes to our first version of these primitive operations was necessary to be fully compatible with MP and pass all the TCKs.