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
Errors thrown while using AsyncSerialExecutionStrategy can cause stuck threads #3548
Comments
catching a throwable is a bit complicated thing: it normally indicates that something is seriously wrong and often you can't really recover from it. It is not a normal exception? Did you encounter this in real life? Which exception did you encounter? |
Yes, I understand that. But if the discussion is around catching Throwable... Currently, the code just crashes and it swallows the Error which is a way bigger issue than catching a Throwable. It took quite an effort to even find this issue. We have experienced this in real life mostly with Catching the Throwable here and completing the future exceptionally is no different than the following code. CompletableFuture<?> future = CompletableFuture.supplyAsync(() -> {
throw new LinkageError();
}).handle((result, throwable) -> result);
future.join();
|
@andimarek Looks like this issue was fixed with @bbakerman commit for implementing polymorphic behavior. Are you open to adding a test for the issue? |
Very much so - thanks |
Describe the bug
If Errors are thrown in a DataFetcher when using AsyncSerialExecutionStrategy then it's possible to craft a query that causes the thread to be stuck indefinitely.
Possible Fix
Catch Throwable here seems to give the correct behavior completing the future exceptionally which eventually hands it back to the JVM.
To Reproduce
Run the following junit test and observe that
errorsShouldBeNotBeSwallowed
will never terminate.Or add this test to AsyncSerialExecutionStrategyTest.groovy and notice the future never completes.
The text was updated successfully, but these errors were encountered: