(proc string, req, resp any)
| 307 | } |
| 308 | |
| 309 | func (n *ClusterNode) call(proc string, req, resp any) error { |
| 310 | if !n.connected { |
| 311 | return errors.New("cluster: node '" + n.name + "' not connected") |
| 312 | } |
| 313 | |
| 314 | if err := n.endpoint.Call(proc, req, resp); err != nil { |
| 315 | logs.Warn.Println("cluster: call failed", n.name, err) |
| 316 | |
| 317 | n.lock.Lock() |
| 318 | if n.connected { |
| 319 | n.endpoint.Close() |
| 320 | n.connected = false |
| 321 | statsInc("LiveClusterNodes", -1) |
| 322 | go n.reconnect() |
| 323 | } |
| 324 | n.lock.Unlock() |
| 325 | return err |
| 326 | } |
| 327 | |
| 328 | return nil |
| 329 | } |
| 330 | |
| 331 | func (n *ClusterNode) handleRpcResponse(call *rpc.Call) { |
| 332 | if call.Error != nil { |
no test coverage detected