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


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 8cc9830b26c [Bug](http-api) fix core dump on /api/reset_rpc_channel 
coz exec_env not initialized (#39207)
8cc9830b26c is described below

commit 8cc9830b26c23ff4bbf3a7bcf34e52e37a953727
Author: Pxl <[email protected]>
AuthorDate: Tue Aug 13 11:54:36 2024 +0800

    [Bug](http-api) fix core dump on /api/reset_rpc_channel coz exec_env not 
initialized (#39207)
    
    pick from #38375
---
 be/src/http/action/reset_rpc_channel_action.cpp    |  2 +-
 .../reset_rpc_channel/reset_rpc_channel.groovy     | 27 ++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/be/src/http/action/reset_rpc_channel_action.cpp 
b/be/src/http/action/reset_rpc_channel_action.cpp
index e1b180a61d4..b14c0f65e7f 100644
--- a/be/src/http/action/reset_rpc_channel_action.cpp
+++ b/be/src/http/action/reset_rpc_channel_action.cpp
@@ -34,7 +34,7 @@
 namespace doris {
 ResetRPCChannelAction::ResetRPCChannelAction(ExecEnv* exec_env, 
TPrivilegeHier::type hier,
                                              TPrivilegeType::type type)
-        : HttpHandlerWithAuth(exec_env, hier, type) {}
+        : HttpHandlerWithAuth(exec_env, hier, type), _exec_env(exec_env) {}
 void ResetRPCChannelAction::handle(HttpRequest* req) {
     std::string endpoints = req->param("endpoints");
     if (iequal(endpoints, "all")) {
diff --git 
a/regression-test/suites/http_p0/reset_rpc_channel/reset_rpc_channel.groovy 
b/regression-test/suites/http_p0/reset_rpc_channel/reset_rpc_channel.groovy
new file mode 100644
index 00000000000..e89289f72fd
--- /dev/null
+++ b/regression-test/suites/http_p0/reset_rpc_channel/reset_rpc_channel.groovy
@@ -0,0 +1,27 @@
+
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite('reset_rpc_channel') {
+    def backendId_to_backendIP = [:]
+    def backendId_to_backendHttpPort = [:]
+    getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort);
+    for (int i=0;i<backendId_to_backendIP.size();i++){
+        def beHttpAddress 
=backendId_to_backendIP.entrySet()[i].getValue()+":"+backendId_to_backendHttpPort.entrySet()[i].getValue()
+        curl("POST",beHttpAddress+"/api/reset_rpc_channel/all")
+    }
+}


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

Reply via email to