This is an automated email from the ASF dual-hosted git repository.

gabriellee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 87a7de76609 [pipelineX](bug) Fix 'No broadcast buffer left' (#27298)
87a7de76609 is described below

commit 87a7de766099d82bb3d05ab805320d30758013b2
Author: Gabriel <[email protected]>
AuthorDate: Mon Nov 20 22:37:21 2023 +0800

    [pipelineX](bug) Fix 'No broadcast buffer left' (#27298)
---
 be/src/pipeline/exec/exchange_sink_operator.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/be/src/pipeline/exec/exchange_sink_operator.h 
b/be/src/pipeline/exec/exchange_sink_operator.h
index 566845639cb..1c7b6cbdaad 100644
--- a/be/src/pipeline/exec/exchange_sink_operator.h
+++ b/be/src/pipeline/exec/exchange_sink_operator.h
@@ -82,13 +82,13 @@ public:
     void set_available_block(int available_block) { _available_block = 
available_block; }
 
     void return_available_block() {
-        _available_block++;
-        WriteDependency::set_ready_for_write();
+        if (_available_block.fetch_add(1) == 0) {
+            WriteDependency::set_ready_for_write();
+        }
     }
 
     void take_available_block() {
-        auto old_vale = _available_block.fetch_sub(1);
-        if (old_vale == 1) {
+        if (_available_block.fetch_sub(1) == 1) {
             WriteDependency::block_writing();
         }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to