[fix](FQDN)fix Checkpoint error (#19678)

Must use Env.getServingEnv() instead of getCurrentEnv(),because here we need to obtain selfNode through the official service catalog.
This commit is contained in:
zhangdong
2023-05-17 08:47:11 +08:00
committed by GitHub
parent ccae3753e7
commit 54507bb058
2 changed files with 4 additions and 2 deletions

View File

@ -31,7 +31,9 @@ public class HttpURLUtil {
public static HttpURLConnection getConnectionWithNodeIdent(String request) throws IOException {
URL url = new URL(request);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
HostInfo selfNode = Env.getCurrentEnv().getSelfNode();
// Must use Env.getServingEnv() instead of getCurrentEnv(),
// because here we need to obtain selfNode through the official service catalog.
HostInfo selfNode = Env.getServingEnv().getSelfNode();
conn.setRequestProperty(Env.CLIENT_NODE_HOST_KEY, selfNode.getHost());
conn.setRequestProperty(Env.CLIENT_NODE_PORT_KEY, selfNode.getPort() + "");
return conn;

View File

@ -71,7 +71,7 @@ public class MetaService extends RestBaseController {
Frontend fe = Env.getCurrentEnv().checkFeExist(clientHost, clientPort);
if (fe == null) {
LOG.warn("request is not from valid FE. client: {}", clientHost);
LOG.warn("request is not from valid FE. client: {}, {}", clientHost, clientPortStr);
return false;
}
return true;