Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
AuthenticationFailure bad exception rethrowing #11022
You can't rethrow an exception from a different thread; it will lead to exceptions with very obscure stacktraces.
A quick look to solution seems to require synchronization on AuthenticatFuture.get method,
As a side node I realized we had a similar problem on invocationFuture, multiple call to InvocationFuture.get results in a exception with stacktrace repeated. If we are OK with that, solution is easy ;). Sample stacktrace to
I would stay away from stacktrace rewriting. We should get rid of it in the future once we can fix the exception throwing behavior of our invocation future (breaking compatibility).
Either wrap an ExecutionException around it and let the caller peel the inner exception if he cares for it. I think this is the most sane approach.
Or wrap it in an AuthenticationException; since the AuthenticationFuture isn't implementing Future interface, you can wrap any exception around it you see fit.