gqlgen icon indicating copy to clipboard operation
gqlgen copied to clipboard

Strange situation after closing subscription connection from playground

Open emeno89 opened this issue 5 years ago • 3 comments

What happened?

"ka" frame sending from server to client (graphql web playground) after closing connection ("stop" frame).

What did you expect?

Connection fully closed, "stop" frame from client and "complete" frame from server are last.

Minimal graphql.schema and models to reproduce

type Subscription { recommendations: RecommendationElement! }

union RecommendationElement = InfoPopup

type InfoPopup { title: String! }

versions

  • gqlgen version: v0.9.0
  • go version: go1.13.3 darwin/amd64
  • dep or go modules? go modules

Hello!

We have one issue with webSocket subscriptions, which reproduced constantly with GraphIQL (Playground):

  1. Playground establish connection with server, first frames are "connection init", "start" and "connection_ack";
  2. Then server sends some "ka" frames (we use keep alive duration 10 seconds);
  3. Then connection stops, using Playground stop button, client sends "stop" and server answers "complete";
  4. After this "ka" frames continue coming to client, and this process stopped only, when Web-Server (we use Ingress in GKE), closed client->server connection after timeout;

image

Seems, "ka" frames ticker must be stopped after "stop" and "complete" message, because go routine continue work without any profit.

Would you help us to solve this problem? Thanks.

emeno89 avatar Dec 08 '19 20:12 emeno89

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 06 '20 20:02 stale[bot]

I have the same problem

zhChenOuO avatar Nov 29 '21 03:11 zhChenOuO

I just stumbled with the same thing while looking why the client wasn't disconnecting or reconnecting after an error.

xbassols avatar Mar 09 '22 16:03 xbassols

I am not able to reproduce this issue with gqlgen 0.17.14.

First of all, I don't see any "ka" frames in spite of me setting the keep alive duration to 10 seconds.

Secondly, when I press the "Stop" button in GraphiQL web playground, client sends "complete", server responds with "complete" and then connection is closed normally.

Screenshot_2022-12-15_09-44-37

rootkea avatar Dec 15 '22 04:12 rootkea