Handle SystemStackError in Execution::Next - #5705
Conversation
|
I'm open to including this, but I'm curious, did you encounter it in normal use? Do you mind sharing a backtrace? Execution::Next doesn't use recursive method calls like the old runtime did, so I'd be surprised if it raised these from its own execution. If these come from application code, would |
|
Thank you for asking. I encountered this during synthetic deep-query testing, not in normal application use. I found that On master, a schema using
The current generated schema is protected by I also tested With this patch, the same query is passed to {
"errors" => [
{ "message" => "This query is too large to execute." }
]
} |
|
Ohhhh right -- I forgot that NullDataloader implements the queue as a stack. (Somewhere in my attempts to speed this up I tried rewriting it to use an actual queue, but without any Fibers. I wonder if that'd still be useful...) Thanks for sharing this fix! |
This PR extends the execution-time
SystemStackErrorhandling added in #5683 toGraphQL::Execution::Next.Previously,
GraphQL::Execution::Nextallowed aSystemStackErrorraised during execution to escape fromGraphQL::Execution::Runner. This bypassedSchema#query_stack_errorand returned an unhandled application error instead of GraphQL-Ruby's configured stack error response.The runner now delegates execution-time stack errors to
Schema#query_stack_error, matching the legacy interpreter behavior.