linksplatform / linksplatform/Data.Doublets.Gql

Error on CTRL+C shutdown

Open
#5 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
9
Forks
2
PR merge metrics
No merged PRs in 30d

Description

konard@konard:~/Archive/Code/Links/Data.Doublets.Gql/csharp/Platform.Data.Doublets.Gql.Server$ dotnet run
[20:01:33 INF] Starting host
Document name (default: db.links): 
[20:01:35 INF] Now listening on: http://localhost:60341
[20:01:35 INF] Application started. Press Ctrl+C to shut down.
[20:01:35 INF] Hosting environment: Development
[20:01:35 INF] Content root path: /home/konard/Archive/Code/Links/Data.Doublets.Gql/csharp/Platform.Data.Doublets.Gql.Server
[20:01:37 INF] Request starting HTTP/1.1 GET http://localhost:60341/graphql - -
[20:01:37 DBG] Connection is a valid websocket request
[20:01:37 DBG] Creating server for connection 0HMB4OLBE4KEL
[20:01:37 DBG] Connected...
[20:01:37 DBG] Creating writer pipeline
[20:01:37 DBG] Writer pipeline created
[20:01:37 DBG] Creating reader pipeline
[20:01:37 DBG] Reader pipeline created
[20:01:37 DBG] Message listeners:
GraphQL.Server.Transports.Subscriptions.Abstractions.LogMessagesListener
GraphQL.Server.Transports.Subscriptions.Abstractions.ProtocolMessageListener

[20:01:38 DBG] Handling message: null of type: connection_init
[20:01:38 DBG] Received message: Type: connection_init Id:  Payload: {}
[20:01:38 DBG] Handle init
[20:01:40 INF] Application is shutting down...
[20:01:45 ERR] An unhandled exception has occurred while executing the request.
System.AggregateException: One or more errors occurred. (One or more errors occurred. (The connection was aborted because the server is shutting down and request processing didn't complete within the time specified by HostOptions.ShutdownTimeout.))
 ---> System.AggregateException: One or more errors occurred. (The connection was aborted because the server is shutting down and request processing didn't complete within the time specified by HostOptions.ShutdownTimeout.)
 ---> Microsoft.AspNetCore.Connections.ConnectionAbortedException: The connection was aborted because the server is shutting down and request processing didn't complete within the time specified by HostOptions.ShutdownTimeout.
   at System.IO.Pipelines.PipeCompletion.ThrowLatchedException()
   at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
   at System.IO.Pipelines.Pipe.ReadAsync(CancellationToken token)
   at System.IO.Pipelines.Pipe.DefaultPipeReader.ReadAsync(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1UpgradeMessageBody.ReadAsyncInternal(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1UpgradeMessageBody.ReadAsync(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpRequestStream.ReadAsyncInternal(Memory`1 destination, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at GraphQL.Server.Transports.Subscriptions.Abstractions.SubscriptionServer.OnConnect() in /_/src/Transports.Subscriptions.Abstractions/SubscriptionServer.cs:line 48
   at GraphQL.Server.Transports.WebSockets.WebSocketConnection.Connect() in /_/src/Transports.Subscriptions.WebSockets/WebSocketConnection.cs:line 21
   at GraphQL.Server.Transports.WebSockets.GraphQLWebSocketsMiddleware`1.InvokeAsync(HttpContext context) in /_/src/Transports.Subscriptions.WebSockets/GraphQLWebSocketsMiddleware.cs:line 66
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
[20:01:45 WRN] The response has already started, the error page middleware will not be executed.
[20:01:45 ERR] Connection id "0HMB4OLBE4KEL", Request id "0HMB4OLBE4KEL:00000002": An unhandled exception was thrown by the application.
System.AggregateException: One or more errors occurred. (One or more errors occurred. (The connection was aborted because the server is shutting down and request processing didn't complete within the time specified by HostOptions.ShutdownTimeout.))
 ---> System.AggregateException: One or more errors occurred. (The connection was aborted because the server is shutting down and request processing didn't complete within the time specified by HostOptions.ShutdownTimeout.)
 ---> Microsoft.AspNetCore.Connections.ConnectionAbortedException: The connection was aborted because the server is shutting down and request processing didn't complete within the time specified by HostOptions.ShutdownTimeout.
   at System.IO.Pipelines.PipeCompletion.ThrowLatchedException()
   at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
   at System.IO.Pipelines.Pipe.ReadAsync(CancellationToken token)
   at System.IO.Pipelines.Pipe.DefaultPipeReader.ReadAsync(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1UpgradeMessageBody.ReadAsyncInternal(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1UpgradeMessageBody.ReadAsync(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpRequestStream.ReadAsyncInternal(Memory`1 destination, CancellationToken cancellationToken)
   at System.Net.WebSockets.ManagedWebSocket.EnsureBufferContainsAsync(Int32 minimumRequiredBytes, CancellationToken cancellationToken, Boolean throwOnPrematureClosure)
   at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TWebSocketReceiveResultGetter,TWebSocketReceiveResult](Memory`1 payloadBuffer, CancellationToken cancellationToken, TWebSocketReceiveResultGetter resultGetter)
   at GraphQL.Server.Transports.WebSockets.WebSocketReaderPipeline.ReadMessageAsync(ITargetBlock`1 target) in /_/src/Transports.Subscriptions.WebSockets/WebSocketReaderPipeline.cs:line 112
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at GraphQL.Server.Transports.Subscriptions.Abstractions.SubscriptionServer.OnConnect() in /_/src/Transports.Subscriptions.Abstractions/SubscriptionServer.cs:line 48
   at GraphQL.Server.Transports.WebSockets.WebSocketConnection.Connect() in /_/src/Transports.Subscriptions.WebSockets/WebSocketConnection.cs:line 21
   at GraphQL.Server.Transports.WebSockets.GraphQLWebSocketsMiddleware`1.InvokeAsync(HttpContext context) in /_/src/Transports.Subscriptions.WebSockets/GraphQLWebSocketsMiddleware.cs:line 66
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
[20:01:45 INF] Request finished HTTP/1.1 GET http://localhost:60341/graphql - - - 101 - - 7205.9903ms
konard@konard:~/Archive/Code/Links/Data.Doublets.Gql/csharp/Platform.Data.Doublets.Gql.Server$ 

This only happens if clients are connected (all 4 in my case).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the shutdown with dotnet run, connected clients, and the /graphql WebSocket endpoint. Start by tracing the shutdown path around GraphQLWebSocketsMiddleware, WebSocketConnection, and SubscriptionServer.OnConnect; done means Ctrl+C shuts down without an unhandled exception for connected clients.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.