Requests will rarely cause a TaskCancelledException e.g.
[2023-01-08 05:50:15 ERR DragaliaAPI.Middleware.ExceptionHandlerMiddleware][0HMNH4TT5AF8G:0000000C][] Encountered unhandled exception: MessagePack.MessagePackSerializationException: Failed to serialize DragaliaAPI.Models.DragaliaResponse`1[[System.Object, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] value.
---> System.OperationCanceledException: The operation was canceled.
at System.Threading.CancellationToken.ThrowOperationCanceledException()
at MessagePack.Formatters.CollectionFormatterBase`4.Serialize(MessagePackWriter& writer, TCollection value, MessagePackSerializerOptions options)
at MessagePack.Formatters.DragaliaAPI_Models_Generated_LoadIndexDataFormatter13.Serialize(MessagePackWriter& writer, LoadIndexData value, MessagePackSerializerOptions options)
at MessagePack.Formatters.DynamicObjectTypeFallbackFormatter.Serialize(MessagePackWriter& writer, Object value, MessagePackSerializerOptions options)
at MessagePack.Formatters.DragaliaAPI_Models_DragaliaResponse`1\[\[System_Object\, System_Private_CoreLib\]\]Formatter1.Serialize(MessagePackWriter& writer, DragaliaResponse`1 value, MessagePackSerializerOptions options)
at MessagePack.MessagePackSerializer.Serialize[T](MessagePackWriter& writer, T value, MessagePackSerializerOptions options)
--- End of inner exception stack trace ---
at MessagePack.MessagePackSerializer.Serialize[T](MessagePackWriter& writer, T value, MessagePackSerializerOptions options)
at lambda_method33(Closure, IBufferWriter`1, Object, MessagePackSerializerOptions, CancellationToken)
at MessagePack.AspNetCoreMvcFormatter.MessagePackOutputFormatter.WriteResponseBodyAsync(OutputFormatterWriteContext context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor.ExecuteAsyncCore(ActionContext context, ObjectResult result, Type objectType, Object value)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeNextResultFilterAsync[TFilter,TFilterAsync]()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at DragaliaAPI.Middleware.ExceptionHandlerMiddleware.InvokeAsync(HttpContext context) in /src/DragaliaAPI/Middleware/ExceptionHandlerMiddleware.cs:line 58
[2023-01-08 05:50:15 INF Serilog.AspNetCore.RequestLoggingMiddleware][0HMNH4TT5AF8G:0000000C][Xyu+EpX5zQrEaV6Z] HTTP POST /2.19.0_20220714193707/load/index responded 200 in 16353.0808 ms
Suspect there is a timeout of 15 seconds somewhere.
Need to look at optimizing the DB queries in these endpoints to improve the speed