924060929 commented on code in PR #70693: URL: https://github.com/apache/doris/pull/70693#discussion_r4627994977
########## regression-test/suites/rpc_p0/test_remote_doris_private_rpc_tls.groovy: ########## @@ -0,0 +1,188 @@ +// 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. + +import groovy.json.JsonSlurper +import org.apache.doris.regression.suite.ConnectionInfo + +import java.nio.file.Files +import java.sql.DriverManager +import java.sql.SQLException +import java.util.concurrent.TimeUnit + +suite("test_remote_doris_private_rpc_tls", "p0,nonConcurrent") { + def logRoot = new File(System.getProperty("DORIS_HOME"), "regression-test/log").toPath() + Files.createDirectories(logRoot) + def logs = Files.createTempDirectory(logRoot, "private-rpc-tls-").toFile() + def helper = new File(context.file.parentFile, "private_rpc_tls_fixture.py") + // Keep lifecycle and port-allocation checks in the default regression entry point as well. + def fixtureTests = new ProcessBuilder("python3", "-m", "unittest", "discover", Review Comment: [P2] Gate the Linux-only fixture before running it in the default suite This suite is selected by the default regression runner and starts the Python tests on every platform. The fixture requires `/proc/<pid>/environ` for PID ownership checks and assumes `127.0.0.2` is available for binding. On macOS, three of the nine helper tests failed and the suite would stop before SQL execution. The same nine tests passed in a Linux container. Please explicitly skip the suite on unsupported platforms while keeping it enabled by default in Linux NonConcurrent CI. ########## fe/fe-core/src/main/java/org/apache/doris/tls/server/OssFeServerStarterProvider.java: ########## @@ -73,36 +77,51 @@ private OssThriftServerStarter(int port, ServerSocket listener) { @Override public void start() throws Exception { - if (Config.enable_tls && TlsProtocolSet.isProtocolIncluded(TlsProtocolSet.Protocol.THRIFT)) { - throw new UnsupportedOperationException("FE thrift TLS requires TLS module"); + boolean tls = PrivateRpcTls.enabled(TlsProtocolSet.Protocol.THRIFT); + if (tls && ThriftServer.THREADED_SELECTOR.equalsIgnoreCase(Config.thrift_server_type)) { + throw new UnsupportedOperationException("Private RPC TLS requires a blocking Thrift server"); } - FrontendServiceImpl service = new FrontendServiceImpl(ExecuteEnv.getInstance()); - Logger feServiceLogger = LogManager.getLogger(FrontendServiceImpl.class); - FrontendService.Iface instance = (FrontendService.Iface) Proxy.newProxyInstance( - FrontendServiceImpl.class.getClassLoader(), - FrontendServiceImpl.class.getInterfaces(), - (proxy, method, args) -> { - long begin = System.currentTimeMillis(); - String name = method.getName(); - if (MetricRepo.isInit) { - MetricRepo.THRIFT_COUNTER_RPC_ALL.getOrAdd(name).increase(1L); - } - feServiceLogger.debug("receive request for {}", name); - try { - return method.invoke(service, args); - } finally { - ConnectContext.remove(); - feServiceLogger.debug("finish process request for {}", name); + ServerSocket transportListener = listener; + boolean started = false; + try { + if (tls) { + transportListener = PrivateRpcTls.thriftServerSocket(new InetSocketAddress( Review Comment: [P2] Keep MaxCompute block allocation working with private Thrift TLS This makes the FE RPC port require mTLS, but `MaxComputeFeClient.createTransport()` in the BE's JVM still opens a plaintext `TSocket` directly. A MaxCompute writer calls `getMaxComputeBlockIdRange` when it needs its first block ID or rotates to a new block. All three retries use plaintext, so the write fails before the FE handler runs. I reproduced this with the actual client and TLS transport on loopback. Plaintext-to-plaintext and TLS-to-TLS calls reached the handler, while the unmodified MaxCompute client was rejected on all three attempts against the TLS listener. Can this callback reuse the BE's internal Thrift transport policy, with a regression that exercises block rotation? -- 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]
