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

FallbackHandler's ExecutionContext should provide Exception getter #224

Closed
derekm opened this issue Feb 3, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@derekm
Copy link

commented Feb 3, 2018

FallbackHandler's ExecutionContext should provide access to the exception that was caught, for example, here: https://github.com/eclipse/microprofile-fault-tolerance/blob/master/api/src/main/java/org/eclipse/microprofile/faulttolerance/Retry.java#L103

@derekm derekm changed the title FallbackHandler's FallbackHandler's ExecutionContext should provide Exception getter Feb 3, 2018

@Emily-Jiang

This comment has been minimized.

Copy link
Member

commented Feb 6, 2018

Can you explain the use case?

@antoinesd

This comment has been minimized.

Copy link
Contributor

commented Feb 7, 2018

Understand the possible use cases here (intelligent fallback according exception type). But wouldn't be too overkill ?

@derekm

This comment has been minimized.

Copy link
Author

commented Feb 8, 2018

We kind of want to notify our callers that a fault occurred, by throwing an exception from the fallback method that the caller can catch for fault details. In order to notify callers of exceptional events, we need our fallback to know about these exceptional events.

We also had ideas about fallbacks that didn't notify their callers but that handled different errors more intelligently. Of course, this could be handled in another way by methods-under-fault doing work before throwing exceptions that trigger MicroProfile Fault Tolerance, but that's actually overkill also (burdening the user-programmer with disparate error-handling logic rather than unifying the error handling logic into the fallback).

We are finding other approaches since both of these ideas are infeasible right now.

@Emily-Jiang

This comment has been minimized.

Copy link
Member

commented Feb 14, 2018

After further discussion in today's hangout, we think it is useful to add a getter in the ExecutionContext interface.

@Emily-Jiang Emily-Jiang added this to the 1.1 milestone Feb 14, 2018

@derekm

This comment has been minimized.

Copy link
Author

commented Feb 14, 2018

Great! Thanks! This will be helpful in the future!

FWIW, for our main situation, we moved our operation that needs Fault Tolerance into an ObserveAsync listener, and we assume the process has failed until it succeeds (that is, we write out "not succeeded" before fireAsync() until a success writes out "succeeded", instead of our fallback handler writing out "failed" when it has failed).

@Emily-Jiang Emily-Jiang self-assigned this Mar 6, 2018

Emily-Jiang pushed a commit that referenced this issue Mar 7, 2018

Emily Jiang
#224 support the exception retrival
Signed-off-by: Emily Jiang <emijiang@uk.ibm.com>

Emily-Jiang added a commit that referenced this issue Mar 7, 2018

Merge pull request #233 from eclipse/emily_ft
#224 support the exception retrival

@Emily-Jiang Emily-Jiang closed this Mar 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.