Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
pd: cancel call when refreshing client #2669
This is a quick fix for possible stale heartbeat streaming call.
Streaming call won't report error when messages are dropped silently in network. However there are sync requests in pd client can detect this error by timeout. When the error is detected, client will be refreshed. At that time, streaming call created by old client should be canceled automatically. But this doesn't happen as expected, so this pr cancels it explicitly.
We need to add a test case to tested this with iptables.
The issue needs to be investaged further too. /cc pingcap/grpc-rs#150
Do we need to call cancel on raft client?
what I mean is not returning Ready and going here https://github.com/BusyJay/tikv/blob/709096a3ec8e0011b6ac4e434e89f3ca2d3a2278/src/pd/util.rs#L70
Is it OK?