GolosChain / golos

Socio-economic mediablockchain
https://developers.golos.io
Other
59 stars 36 forks source link

Add auto-reconnect of cli_wallet to golosd on losing connection #516

Closed zxcat closed 6 years ago

zxcat commented 6 years ago

Steps to reproduce

  1. Run cli_wallet
  2. Send any command, which use websocket, e.g. >>> get_block 123
  3. Wait some time, websocket will disconnect silently
  4. Send other websocket related command

Actual results From this point all websocket related commands will fail with

10 assert_exception: Assert Exception
!ec: websocket send failed: invalid state
    {"msg":"invalid state"}
    th_0  websocket.cpp:165 send_message

Expected results Command in step 4 and all following commands works fine

VIM-Arcange commented 6 years ago

@zxcat Does your cli_wallet connect to a local node (on same host/network) or a remote (public) node?

zxcat commented 6 years ago

@VIM-Arcange testing on remote nodes, they disconnect ws clients after some inactivity

VIM-Arcange commented 6 years ago

Then it looks like a problem of the remote site infrastructure, not cli_wallet This often happens when the node is behind nginx and nginx is not properly configured.

I have cli_wallet running in screen and connected to my own nodes. I do now experience such disconnection problems.

Anyway, this does not prevent from implementing some "re-connection" mechanism in cli_wallet.

kotbegemot commented 6 years ago

https://github.com/GolosChain/golos/pull/523