vagetablechicken commented on a change in pull request #3143: Non blocking 
OlapTableSink
URL: https://github.com/apache/incubator-doris/pull/3143#discussion_r395456198
 
 

 ##########
 File path: be/src/exec/tablet_sink.cpp
 ##########
 @@ -128,55 +127,127 @@ Status NodeChannel::open_wait() {
     _open_closure = nullptr;
 
     // add batch closure
-    _add_batch_closure = new RefCountClosure<PTabletWriterAddBatchResult>();
-    _add_batch_closure->ref();
+    _add_batch_closure = 
ReusableClosure<PTabletWriterAddBatchResult>::create();
+    _add_batch_closure->addFailedHandler([&]() {
 
 Review comment:
   The two handlers both need to capture _rpc_error(the member variable), I'm 
afraid I can only change [&] to [this].
   There's an alternate way to explicit capture, although I don't like this 
style. How about this?
   ```
   auto& rpc_error_ref=_rpc_error;
   _add_batch_closure->addFailedHandler([&rpc_error_ref](){})
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to