| 710 | } |
| 711 | |
| 712 | void KrpcDataStreamSender::Channel::Teardown(RuntimeState* state) { |
| 713 | // Normally, the channel should have been flushed before calling Teardown(), which means |
| 714 | // that all the data should already be drained. If the fragment was was closed or |
| 715 | // cancelled, there may still be some in-flight RPCs and buffered row batches to be |
| 716 | // flushed. |
| 717 | std::unique_lock<SpinLock> l(lock_); |
| 718 | shutdown_ = true; |
| 719 | // Cancel any in-flight RPC. |
| 720 | if (rpc_in_flight_) { |
| 721 | rpc_controller_.Cancel(); |
| 722 | while (rpc_in_flight_) rpc_done_cv_.wait(l); |
| 723 | } |
| 724 | outbound_batch_.reset(nullptr); |
| 725 | } |
| 726 | |
| 727 | /// KrpcDataStreamSender's generic partitioning and serialization methods are inefficient |
| 728 | /// for Iceberg position delete records. This class stores and efficiently serializes |