centrifugal / centrifugo

Scalable real-time messaging server in a language-agnostic way. Self-hosted alternative to Pubnub, Pusher, Ably. Set up once and forever.
https://centrifugal.dev
Apache License 2.0
8.12k stars 580 forks source link

Centrifugo 1.6.x can close connection without any reason #142

Closed korvinko closed 7 years ago

korvinko commented 7 years ago

Centrifugo 1.6.1 run locally on 127.0.0.1 with memory engine. After some random actions on page it can suddenly close connection though I do not leave page or close connection by javacript API.

Server logs: image

Client logs: image

Server config:

{
  "secret": "sec"
  "admin_password": "pass",
  "admin_secret": "admin_sec",
  "join_leave": false,
  "anonymous": false,
  "publish": true,
  "watch": true,
  "presence": true,
  "history_size": 100,
  "history_lifetime": 1800,
  "recover": true,
  "history_drop_inactive": true,
  "namespaces": [
    {
      "name": "system",
      "publish": true,
      "anonymous": true,
      "watch": true,
      "presence": true,
      "join_leave": true,
      "history_size": 0,
      "history_lifetime": 0,
      "history_drop_inactive": false
    }
  ]
}

Last messages before disconnect: image

Centrifugo web admin "messages" section does not show any big messages. And can not be problem with network because it run locally.

korvinko commented 7 years ago

Same for 1.6.2

FZambia commented 7 years ago

Thanks for a report!

Do you use latest javascript client? Could you try to reproduce this when ping: false in js client options?

korvinko commented 7 years ago

Yes, ping: false solved problem.

On client side centrifugo-js: 1.4.1 without sockjs.

FZambia commented 7 years ago

Yeah, I see a problem - it's introduced with 1.6.0, will fix it very soon, until that moment you can use ping: false to avoid such disconnects.

FZambia commented 7 years ago

@johndoejdg fixed in 1.6.3, many thanks for your detailed report

Also I suggest updating centrifuge-js to version 1.4.2 for those who use SockJS polling transports.