SendRequest sends a coordinate request on the client connection, holding the coordination lock to prevent concurrent writes on the dRPC stream.
(req *proto.CoordinateRequest)
| 238 | // SendRequest sends a coordinate request on the client connection, holding |
| 239 | // the coordination lock to prevent concurrent writes on the dRPC stream. |
| 240 | func (c *BasicCoordination) SendRequest(req *proto.CoordinateRequest) error { |
| 241 | c.Lock() |
| 242 | defer c.Unlock() |
| 243 | if c.closed { |
| 244 | return xerrors.New("coordination is closed") |
| 245 | } |
| 246 | return c.client.Send(req) |
| 247 | } |
| 248 | |
| 249 | // Close the coordination gracefully. If the context expires before the remote API server has hung |
| 250 | // up on us, we forcibly close the Client connection. |