zhongjiajie commented on a change in pull request #8248:
URL: https://github.com/apache/dolphinscheduler/pull/8248#discussion_r795010513



##########
File path: 
dolphinscheduler-python/src/main/java/org/apache/dolphinscheduler/server/PythonGatewayServer.java
##########
@@ -501,10 +507,28 @@ public void createUser(String userName,
 
     @PostConstruct
     public void run() {
-        GatewayServer server = new GatewayServer(this);
-        GatewayServer.turnLoggingOn();
-        // Start server to accept python client socket
-        server.start();
+        GatewayServer server;
+        try {
+            InetAddress gatewayHost = 
InetAddress.getByName(pythonGatewayConfig.getGatewayServerAddress());
+            InetAddress pythonHost = 
InetAddress.getByName(pythonGatewayConfig.getPythonAddress());
+            server = new GatewayServer(
+                this,
+                pythonGatewayConfig.getGatewayServerPort(),
+                pythonGatewayConfig.getPythonPort(),
+                gatewayHost,
+                pythonHost,
+                pythonGatewayConfig.getConnectTimeout(),
+                pythonGatewayConfig.getReadTimeout(),
+                null
+            );
+            GatewayServer.turnLoggingOn();
+            logger.info("PythonGatewayServer started on: " + 
gatewayHost.toString());
+            server.start();
+        }
+        catch (UnknownHostException e) {
+            logger.error("exception occurred while constructing 
PythonGatewayServer().");
+            e.printStackTrace();
+        }

Review comment:
       Thanks




-- 
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]


Reply via email to