-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Improve mechanism for extracting the result of a PlainActionFuture
#108125
Comments
Pinging @elastic/es-distributed (Team:Distributed) |
Just had an initial look at this one. If I understand correctly the goal is
If we implement that, what do we expect from The equivalent behaviour post-change would seem to be to unwrap the |
My preference would be to avoid any conditional wrapping or unwrapping so that the caller can easily get hold of the exact exception that completed the listener. We could declare that
|
If a
PlainActionFuture
is known to be complete then it seems we should be able to extract its result, but in fact today there's not really a good way to do this truly accurately:result()
method mangles checked exceptions, but not unchecked ones, so it's impossible to unmangle the result accurately.get()
method yields exceptions faithfully but will throw anInterruptedException
if the calling thread is in an interrupted state even if the result is available and no blocking occurs.I think I'd be inclined to change
result()
to wrap any exception in anExecutionException
always, and fix up the callers to handle this. It's only used in tests today. But maybe there are other ideas too.The text was updated successfully, but these errors were encountered: