github-actions[bot] commented on code in PR #29791:
URL: https://github.com/apache/doris/pull/29791#discussion_r1447277587


##########
be/src/vec/sink/load_stream_stub.cpp:
##########
@@ -299,6 +302,36 @@ Status LoadStreamStub::wait_for_schema(int64_t 
partition_id, int64_t index_id, i
     return Status::OK();
 }
 
+Status LoadStreamStub::close_wait(int64_t timeout_ms) {
+    DBUG_EXECUTE_IF("LoadStreamStub::close_wait.long_wait", {
+        while (true) {
+        };
+    });
+    if (!_is_init.load() || _is_closed.load()) {
+        return Status::OK();
+    }
+    if (timeout_ms <= 0) {
+        timeout_ms = config::close_load_stream_timeout_ms;
+    }
+    DCHECK(timeout_ms > 0) << "timeout_ms should be greator than 0";
+    std::unique_lock<bthread::Mutex> lock(_close_mutex);
+    if (_is_closed.load()) {
+        return Status::OK();
+    }
+    int ret = _close_cv.wait_for(lock, timeout_ms * 1000);
+    if (ret != 0) {
+        return Status::InternalError(
+                "stream close_wait timeout, error={}, load_id={}, dst_id={}, 
stream_id={}", ret,
+                print_id(_load_id), _dst_id, _stream_id);
+    }
+    if (!_is_eos.load()) {
+        return Status::InternalError(
+                "stream closed without eos, load_id={}, dst_id={}, 
stream_id={}",
+                print_id(_load_id), _dst_id, _stream_id);
+    }
+    return Status::OK();
+}
+

Review Comment:
   warning: method '_encode_and_send' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
   static Status LoadStreamStub::_encode_and_send(PStreamHeader& header, 
std::span<const Slice> data) {
   ```
   



-- 
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]

Reply via email to