gavinchou commented on code in PR #53144:
URL: https://github.com/apache/doris/pull/53144#discussion_r2203745833
##########
be/src/http/action/stream_load.cpp:
##########
@@ -155,46 +207,9 @@ void StreamLoadAction::handle(HttpRequest* req) {
streaming_load_duration_ms->increment(ctx->load_cost_millis);
}
-Status StreamLoadAction::_handle(std::shared_ptr<StreamLoadContext> ctx) {
- if (ctx->body_bytes > 0 && ctx->receive_bytes != ctx->body_bytes) {
- LOG(WARNING) << "recevie body don't equal with body bytes,
body_bytes=" << ctx->body_bytes
- << ", receive_bytes=" << ctx->receive_bytes << ", id=" <<
ctx->id;
- return Status::Error<ErrorCode::NETWORK_ERROR>("receive body don't
equal with body bytes");
- }
-
- // if we use non-streaming, MessageBodyFileSink.finish will close the file
- RETURN_IF_ERROR(ctx->body_sink->finish());
- if (!ctx->use_streaming) {
- // we need to close file first, then execute_plan_fragment here
- ctx->body_sink.reset();
- TPipelineFragmentParamsList mocked;
-
RETURN_IF_ERROR(_exec_env->stream_load_executor()->execute_plan_fragment(ctx,
mocked));
- }
-
- // wait stream load finish
- RETURN_IF_ERROR(ctx->future.get());
-
- if (ctx->group_commit) {
- LOG(INFO) << "skip commit because this is group commit, pipe_id=" <<
ctx->id.to_string();
- return Status::OK();
- }
-
- if (ctx->two_phase_commit) {
- int64_t pre_commit_start_time = MonotonicNanos();
-
RETURN_IF_ERROR(_exec_env->stream_load_executor()->pre_commit_txn(ctx.get()));
- ctx->pre_commit_txn_cost_nanos = MonotonicNanos() -
pre_commit_start_time;
- } else {
- // If put file success we need commit this load
- int64_t commit_and_publish_start_time = MonotonicNanos();
-
RETURN_IF_ERROR(_exec_env->stream_load_executor()->commit_txn(ctx.get()));
- ctx->commit_and_publish_txn_cost_nanos = MonotonicNanos() -
commit_and_publish_start_time;
- g_stream_load_commit_and_publish_latency_ms
- << ctx->commit_and_publish_txn_cost_nanos / 1000000;
- }
- return Status::OK();
-}
-
int StreamLoadAction::on_header(HttpRequest* req) {
+ req->mark_send_reply();
Review Comment:
这么改完之后 所有的请求都走async了?
--
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]