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 02:05:19 UTC

[incubator-doris] branch master updated: [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 master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 8765881d8b [fix](load) wait _send_batch_thread_pool_token rather than shutdown. (#8970)
8765881d8b is described below

commit 8765881d8b8d82d70501a5bc7679b959ee5908d9
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 77eb6f1dae..e8b35c16d1 100644
--- a/be/src/exec/tablet_sink.cpp
+++ b/be/src/exec/tablet_sink.cpp
@@ -1107,7 +1107,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