Skip to content

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

Closed
@SylarChen

Description

@SylarChen

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 ...
                  }
            });

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions