You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2022/04/14 13:56:40 UTC

[incubator-doris] 05/07: [fix](load) wait _send_batch_thread_pool_token rather than shutdown. (#8970)

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

morningman pushed a commit to branch dev-1.0.1
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git

commit dd7bd2eb813e06a85548f28a2cde37421605f7f0
Author: dataroaring <98...@users.noreply.github.com>
AuthorDate: Thu Apr 14 10:05:14 2022 +0800

    [fix](load) wait _send_batch_thread_pool_token rather than shutdown. (#8970)
    
    We can not shutdown _send_batch_thread_pool_token, because _packet_in_flight
    has to be clear finally. Otherwise a never ended join on rpc would happen.
    
    It is difficult to handle concurrent problem if a flag setter is not guaranteed to run.
---
 be/src/exec/tablet_sink.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/be/src/exec/tablet_sink.cpp b/be/src/exec/tablet_sink.cpp
index 4a46d538ee..5604483012 100644
--- a/be/src/exec/tablet_sink.cpp
+++ b/be/src/exec/tablet_sink.cpp
@@ -1087,7 +1087,10 @@ Status OlapTableSink::close(RuntimeState* state, Status close_status) {
     _stop_background_threads_latch.count_down();
     if (_sender_thread) {
         _sender_thread->join();
-        _send_batch_thread_pool_token->shutdown();
+        // We have to wait all task in _send_batch_thread_pool_token finished,
+        // because it is difficult to handle concurrent problem if we just
+        // shutdown it.
+        _send_batch_thread_pool_token->wait();
     }
 
     Expr::close(_output_expr_ctxs, state);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org