Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.9k
[refine](pipelineX)Make the 'set ready' logic of SenderQueue in pipelineX the same as that in the pipeline.#28488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -100,7 +100,8 @@ Status VDataStreamRecvr::SenderQueue::_inner_get_batch_without_lock(Block* block | ||
| auto [next_block, block_byte_size] = std::move(_block_queue.front()); | ||
| _recvr->update_blocks_memory_usage(-block_byte_size); | ||
| _block_queue.pop_front(); | ||
| if (_block_queue.size() == 0 && _dependency) { | ||
| _record_debug_info(); | ||
| if (_block_queue.empty() && _dependency) { | ||
| if (!_is_cancelled && _num_remaining_senders > 0) { | ||
| _dependency->block(); | ||
| } | ||
| @@ -122,6 +123,16 @@ Status VDataStreamRecvr::SenderQueue::_inner_get_batch_without_lock(Block* block | ||
| return Status::OK(); | ||
| } | ||
| void VDataStreamRecvr::SenderQueue::try_set_dep_ready_without_lock() { | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: method 'try_set_dep_ready_without_lock' can be made static [readability-convert-member-functions-to-static] be/src/vec/runtime/vdata_stream_recvr.h:243: - void try_set_dep_ready_without_lock();+ static void try_set_dep_ready_without_lock(); | ||
| if (!_dependency) { | ||
| return; | ||
| } | ||
| const bool should_wait = !_is_cancelled && _block_queue.empty() && _num_remaining_senders > 0; | ||
| if (!should_wait) { | ||
| _dependency->set_ready(); | ||
| } | ||
| } | ||
| Status VDataStreamRecvr::SenderQueue::add_block(const PBlock& pblock, int be_number, | ||
| int64_t packet_seq, | ||
| ::google::protobuf::Closure** done) { | ||
| @@ -178,9 +189,8 @@ Status VDataStreamRecvr::SenderQueue::add_block(const PBlock& pblock, int be_num | ||
| if (!empty) { | ||
| _block_queue.emplace_back(std::move(block), block_byte_size); | ||
| if (_dependency) { | ||
| _dependency->set_ready(); | ||
| } | ||
| _record_debug_info(); | ||
| try_set_dep_ready_without_lock(); | ||
| } | ||
| // if done is nullptr, this function can't delay this response | ||
| if (done != nullptr && _recvr->exceeds_limit(block_byte_size)) { | ||
| @@ -234,9 +244,8 @@ void VDataStreamRecvr::SenderQueue::add_block(Block* block, bool use_move) { | ||
| if (!empty) { | ||
| _block_queue.emplace_back(std::move(nblock), block_mem_size); | ||
| if (_dependency) { | ||
| _dependency->set_ready(); | ||
| } | ||
| _record_debug_info(); | ||
| try_set_dep_ready_without_lock(); | ||
| _data_arrival_cv.notify_one(); | ||
| } | ||
| @@ -269,13 +278,12 @@ void VDataStreamRecvr::SenderQueue::decrement_senders(int be_number) { | ||
| _sender_eos_set.insert(be_number); | ||
| DCHECK_GT(_num_remaining_senders, 0); | ||
| _num_remaining_senders--; | ||
| _record_debug_info(); | ||
| VLOG_FILE << "decremented senders: fragment_instance_id=" | ||
| << print_id(_recvr->fragment_instance_id()) << " node_id=" << _recvr->dest_node_id() | ||
| << " #senders=" << _num_remaining_senders; | ||
| if (_num_remaining_senders == 0) { | ||
| if (_dependency) { | ||
| _dependency->set_ready(); | ||
| } | ||
| try_set_dep_ready_without_lock(); | ||
| _data_arrival_cv.notify_one(); | ||
| } | ||
| } | ||
| @@ -288,9 +296,7 @@ void VDataStreamRecvr::SenderQueue::cancel(Status cancel_status) { | ||
| } | ||
| _is_cancelled = true; | ||
| _cancel_status = cancel_status; | ||
| if (_dependency) { | ||
| _dependency->set_ready(); | ||
| } | ||
| try_set_dep_ready_without_lock(); | ||
| VLOG_QUERY << "cancelled stream: _fragment_instance_id=" | ||
| << print_id(_recvr->fragment_instance_id()) | ||
| << " node_id=" << _recvr->dest_node_id(); | ||
| @@ -318,9 +324,7 @@ void VDataStreamRecvr::SenderQueue::close() { | ||
| // is clear will be memory leak | ||
| std::lock_guard<std::mutex> l(_lock); | ||
| _is_cancelled = true; | ||
| if (_dependency) { | ||
| _dependency->set_ready(); | ||
| } | ||
| try_set_dep_ready_without_lock(); | ||
| for (auto closure_pair : _pending_closures) { | ||
| closure_pair.first->Run(); | ||
| @@ -561,9 +565,8 @@ void VDataStreamRecvr::PipSenderQueue::add_block(Block* block, bool use_move) { | ||
| return; | ||
| } | ||
| _block_queue.emplace_back(std::move(nblock), block_mem_size); | ||
| if (_dependency) { | ||
| _dependency->set_ready(); | ||
| } | ||
| _record_debug_info(); | ||
| try_set_dep_ready_without_lock(); | ||
| COUNTER_UPDATE(_recvr->_local_bytes_received_counter, block_mem_size); | ||
| _recvr->update_blocks_memory_usage(block_mem_size); | ||
| _data_arrival_cv.notify_one(); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'try_set_dep_ready_without_lock' can be made static [readability-convert-member-functions-to-static]
be/src/vec/runtime/vdata_stream_recvr.h:242: