mpetrunic / fastify-sse-v2

Provide Server-Sent Events to Fastify
MIT License
99 stars 19 forks source link

session close after 60 seconds of "idle" time? #56

Closed paul-bell closed 1 year ago

paul-bell commented 1 year ago

Hello,

I've begun using your fastify-sse-v2.

My curl client terminates after ~60 seconds of idle time:

retry: 3000

* transfer closed with outstanding read data remaining
* Closing connection 0
curl: (18) transfer closed with outstanding read data remaining

By "idle" I mean that the SSE server hasn't received any events in 60 seconds (quite likely in this app) and thus hasn't sent any on to the curl client.

  1. Does your plugin close the session after 60 seconds of no events?
  2. If so, is this value configurable?
  3. If not, do you know where this close is occurring?

I do realize that a real-world client would be reconnecting when this occurs.

Thanks for this plugin, and for your help.

mpetrunic commented 1 year ago

Does your plugin close the session after 60 seconds of no events?

Nope

If so, is this value configurable?

It's not since plugin is not setting that value

If not, do you know where this close is occurring?

You can look into fastify's keepAliveTimeout. Since you said it's after 60s, do you maybe use nginx? Because, I think, nginx has default keepAlive timeout of 60s

paul-bell commented 1 year ago

Thank you very much for your reply; most helpful.

Indeed, nginx is implicated here. I will dig into it and into fastify's keepAliveTimeout.

mpetrunic commented 1 year ago

I will close this issue, let me know if something comes up that is plugin responsibility^^