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

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 1ca96a16110799d9ef0d899432742fc93c7800f0
Author: HHoflittlefish777 <[email protected]>
AuthorDate: Sat Apr 20 01:27:37 2024 +0800

    [fix](stream-load) fix stream load and http stream metric error #33899
---
 be/src/http/action/http_stream.cpp | 3 +--
 be/src/http/action/stream_load.cpp | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/be/src/http/action/http_stream.cpp 
b/be/src/http/action/http_stream.cpp
index 8e6bc204feb..b07166a3717 100644
--- a/be/src/http/action/http_stream.cpp
+++ b/be/src/http/action/http_stream.cpp
@@ -126,7 +126,6 @@ void HttpStreamAction::handle(HttpRequest* req) {
     // update statistics
     http_stream_requests_total->increment(1);
     http_stream_duration_ms->increment(ctx->load_cost_millis);
-    http_stream_current_processing->increment(-1);
 }
 
 Status HttpStreamAction::_handle(HttpRequest* http_req, 
std::shared_ptr<StreamLoadContext> ctx) {
@@ -183,7 +182,6 @@ int HttpStreamAction::on_header(HttpRequest* req) {
         // add new line at end
         str = str + '\n';
         HttpChannel::send_reply(req, str);
-        http_stream_current_processing->increment(-1);
         if (config::enable_stream_load_record) {
             str = ctx->prepare_stream_load_record(str);
             _save_stream_load_record(ctx, str);
@@ -287,6 +285,7 @@ void 
HttpStreamAction::free_handler_ctx(std::shared_ptr<void> param) {
     }
     // remove stream load context from stream load manager and the resource 
will be released
     ctx->exec_env()->new_load_stream_mgr()->remove(ctx->id);
+    http_stream_current_processing->increment(-1);
 }
 
 Status HttpStreamAction::process_put(HttpRequest* http_req,
diff --git a/be/src/http/action/stream_load.cpp 
b/be/src/http/action/stream_load.cpp
index 995d08b0af9..6ecb12ab806 100644
--- a/be/src/http/action/stream_load.cpp
+++ b/be/src/http/action/stream_load.cpp
@@ -138,7 +138,6 @@ void StreamLoadAction::handle(HttpRequest* req) {
     // update statistics
     streaming_load_requests_total->increment(1);
     streaming_load_duration_ms->increment(ctx->load_cost_millis);
-    streaming_load_current_processing->increment(-1);
 }
 
 Status StreamLoadAction::_handle(std::shared_ptr<StreamLoadContext> ctx) {
@@ -216,7 +215,6 @@ int StreamLoadAction::on_header(HttpRequest* req) {
         // add new line at end
         str = str + '\n';
         HttpChannel::send_reply(req, str);
-        streaming_load_current_processing->increment(-1);
 #ifndef BE_TEST
         if (config::enable_stream_load_record) {
             str = ctx->prepare_stream_load_record(str);
@@ -376,6 +374,7 @@ void 
StreamLoadAction::free_handler_ctx(std::shared_ptr<void> param) {
     }
     // remove stream load context from stream load manager and the resource 
will be released
     ctx->exec_env()->new_load_stream_mgr()->remove(ctx->id);
+    streaming_load_current_processing->increment(-1);
 }
 
 Status StreamLoadAction::_process_put(HttpRequest* http_req,


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to