Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
distsql: improve SetupFlow RPC handling by server when canceled
This commit makes the server-side of `SetupFlow` RPC react better to the context cancellation. In particular, after setting up the flow on the remote node but before starting it in a new goroutine we now check whether the context of the RPC is canceled or not; if it is, then we don't actually need to run the flow at all, so we now short-circuit. This improves the shutdown protocol in some cases when the context is canceled on the gateway (client-side of the RPC) after we have dialed the node in `runnerRequest.run` but before the new goroutine handling the RPC on the client side has been spun up. This scenario is pretty rare currently but might occur more often due to the changes in the following commit. Note that there is no correctness issue here - even before this change, the flow would be shutdown properly (when the outbox would fail to execute `FlowStream` RPC due to the inbox having exited). Release note: None
- Loading branch information