Mryange commented on code in PR #63055:
URL: https://github.com/apache/doris/pull/63055#discussion_r3200143231
##########
be/src/exec/operator/data_queue.cpp:
##########
@@ -29,38 +29,28 @@
namespace doris {
void SubQueue::try_pop(std::unique_ptr<Block>* output_block) {
- bool need_notify_sink_ready = false;
- {
- LockGuard l(queue_lock);
- if (!blocks.empty()) {
- *output_block = std::move(blocks.front());
- blocks.pop_front();
- bytes_in_queue -= (*output_block)->allocated_bytes();
- blocks_in_queue -= 1;
- need_notify_sink_ready = blocks.empty();
+ LockGuard l(queue_lock);
+ if (!blocks.empty()) {
+ *output_block = std::move(blocks.front());
+ blocks.pop_front();
+ bytes_in_queue -= (*output_block)->allocated_bytes();
+ blocks_in_queue -= 1;
+ if (blocks.empty()) {
+ sink_dependency->set_ready();
}
Review Comment:
> This reintroduces dependency notification while `queue_lock` is held.
`Dependency::set_ready()` takes `_task_lock` and wakes blocked tasks, and the
same hunk now also calls `sink_dependency->block()` under `queue_lock` in
`try_push()`. The previous code explicitly deferred both calls until after
releasing `queue_lock` to avoid nested locks, and `clear_blocks()` still
follows that pattern. Please keep the boolean flag approach and call dependency
methods after `queue_lock` is released; otherwise source/sink pipeline tasks
can hit lock-order stalls or deadlock when a woken task re-enters this queue
path.
try_pop 是source在执行,这里ready的是sink,不会出现你说问题?请重新review下。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]