[pipelineX](fix) Fix use-after-free in shuffling (#25409)

This commit is contained in:
Gabriel
2023-10-13 16:57:34 +08:00
committed by GitHub
parent 37dbda6209
commit ac8fbdd53c

View File

@ -364,11 +364,11 @@ void ExchangeSinkBuffer<Parent>::_ended(InstanceLoId id) {
std::unique_lock<std::mutex> lock(*_instance_to_package_queue_mutex[id]);
if (!_rpc_channel_is_idle[id]) {
_busy_channels--;
_rpc_channel_is_idle[id] = true;
if (_finish_dependency && _busy_channels == 0) {
_finish_dependency->set_ready_to_finish();
}
}
_rpc_channel_is_idle[id] = true;
}
template <typename Parent>
@ -384,11 +384,11 @@ void ExchangeSinkBuffer<Parent>::_set_receiver_eof(InstanceLoId id) {
_instance_to_receiver_eof[id] = true;
if (!_rpc_channel_is_idle[id]) {
_busy_channels--;
_rpc_channel_is_idle[id] = true;
if (_finish_dependency && _busy_channels == 0) {
_finish_dependency->set_ready_to_finish();
}
}
_rpc_channel_is_idle[id] = true;
}
template <typename Parent>