server: Asp.net core 6 request aborted after 5 second timeout

Problem

I was having a lot of issues with any GQL query or mutation that takes more than 5 seconds. After digging for a few days I found an article on Microsoft’s site talking about request draining and how it has a non-configurable 5 second timeout before it aborts the request.

Supporting docs

https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel/request-draining?view=aspnetcore-6.0

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (13 by maintainers)

Most upvoted comments

I do not have an answer yet. I do not believe I have experienced it in my own code, but it certainly is evident here.

@sungam3r This is reproducible with this simple change to ChatQuery.cs in Samples.Schemas.Chat when running Samples.Server:

            FieldAsync<StringGraphType>("test", resolve: async context =>
            {
                await Task.Delay(6000, context.CancellationToken);
                return "ok";
            });