AnyCable-Go version: 0.6.3
AnyCable gem version: 0.6.3 (same anycable-rails version)
gRPC gem version: 1.20.0
nginx version: 1.17.3
What did you do?
- Use nginx + grpc module setup. Gist link
- Run two instance of gRPC servers via
bundle exec anycable --rpc_host 0.0.0.0:50052 and bundle exec anycable --rpc_host 0.0.0.0:50051
- Run an instance of
anycable-go via anycable-go --headers=origin,cookie --debug=true --rpc_host=localhost:50050
- Subscribe to a channel. Nothing fancy here, using the JS
ActionCable.subscribe.
- Perform actions on the subscription periodically every 10 seconds in JS –
subscription.perform 'do_stuff'.
- Stop both gRPC anycable instances without de-registering any from nginx.
- On the next
do_stuff action, the anycable-go server receives error 502 from nginx since both gRPC servers are gone.
What did you expect to happen?
The anycable-go server to raise an error similar to when no connection to the gRPC is available (Perform error: rpc error: code = Unavailable desc = all SubConns are in TransientFailure,) and retry communicating with the gRPC server on the next do_stuff action.
What actually happened?
After 7., no attempt to send requests to the gRPC server are made (nothing is logged in the anycable-go server and nothing is available in the nginx access log), even if the gRPC servers are started up again. Meanwhile, the client get successful ping messages and can receive broadcasts and through the WS.
If another client gets to subscribe to the same channel they'll either 1) get an error forcing them to reconnect when the gRPC servers are all down or 2) successfully subscribe and perform actions when the gRPC servers are up. The first client will still remain "stuck" however.
Bottom line is that performing actions on a subscription after getting error 502 blocks all new actions from being performed by the anycable-go server for a particular client/subscription.
Could you please give some directions on how to deal with this scenario? One possibility is to 'ack' for actions on the client side and reconnect altogether, but it adds some complexity.
AnyCable-Go version: 0.6.3
AnyCable gem version: 0.6.3 (same
anycable-railsversion)gRPC gem version: 1.20.0
nginx version: 1.17.3
What did you do?
bundle exec anycable --rpc_host 0.0.0.0:50052andbundle exec anycable --rpc_host 0.0.0.0:50051anycable-goviaanycable-go --headers=origin,cookie --debug=true --rpc_host=localhost:50050ActionCable.subscribe.subscription.perform 'do_stuff'.do_stuffaction, theanycable-goserver receives error502from nginx since both gRPC servers are gone.What did you expect to happen?
The
anycable-goserver to raise an error similar to when no connection to the gRPC is available (Perform error: rpc error: code = Unavailable desc = all SubConns are in TransientFailure,) and retry communicating with the gRPC server on the nextdo_stuffaction.What actually happened?
After 7., no attempt to send requests to the gRPC server are made (nothing is logged in the
anycable-goserver and nothing is available in the nginx access log), even if the gRPC servers are started up again. Meanwhile, the client get successful ping messages and can receive broadcasts and through the WS.If another client gets to subscribe to the same channel they'll either 1) get an error forcing them to reconnect when the gRPC servers are all down or 2) successfully subscribe and perform actions when the gRPC servers are up. The first client will still remain "stuck" however.
Bottom line is that performing actions on a subscription after getting error
502blocks all new actions from being performed by theanycable-goserver for a particular client/subscription.Could you please give some directions on how to deal with this scenario? One possibility is to 'ack' for actions on the client side and reconnect altogether, but it adds some complexity.