Skip to content

Uncaught exception thrown by HttpRequestInvokerImpl.invoke() causes main thread to "hang" #403

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

Closed
SylarChen opened this issue Dec 22, 2021 · 0 comments
Labels
Milestone

Comments

@SylarChen
Copy link

Describe the bug
on servlet async mode, uncatched exception throwed from graphql.kickstart.servlet.HttpRequestInvokerImpl.invoke() will "hang" the main thread, till servlet timeout.

To Reproduce

  1. construct a bad data input to let graphql validation failed. in other words, construct any uncatched exception throwed from graphql.kickstart.servlet.HttpRequestInvokerImpl.invoke()
  2. we will see the error printed on console immediately
  3. client get the data till servlet timeout. and the error msg is about timeout not the exception we made.

Expected behavior
client get the precise exception information immediately.

Screenshots
image
image
image

Version:

  • graphql.java 17.3
  • graphql.java.kickstart.servlet 12.0.0

Additional context
maybe some code like this

    configuration
        .getAsyncExecutor()
        .execute(
            () -> {
                  try{
                        FutureExecutionResult futureResult = invoke(invocationInput, request, response);
                        futureHolder.set(futureResult);
                        handle(futureResult, request, response, listenerHandler)
                            .thenAccept(it -> asyncContext.complete());
                  }catch(Exception){
                        // write result & apply RequestCallback ...
                  }
            });
@SylarChen SylarChen added the bug label Dec 22, 2021
@oliemansm oliemansm changed the title uncatched exception throwed from graphql.kickstart.servlet.HttpRequestInvokerImpl.invoke() will "hang" the main thread Uncaught exception thrown by HttpRequestInvokerImpl.invoke() causes main thread to "hang" Jan 23, 2022
@oliemansm oliemansm added this to the 13.0.0 milestone Jan 23, 2022
oliemansm added a commit that referenced this issue Jan 23, 2022
…-async-exception

fix: handle exception in async mode fixes #403
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants