code-dm commented on code in PR #22118:
URL: https://github.com/apache/flink/pull/22118#discussion_r1138081208


##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/SqlGateway.java:
##########
@@ -109,16 +113,20 @@ static void startSqlGateway(PrintStream stream, String[] 
args) {
         SignalHandler.register(LOG);
         JvmShutdownSafeguard.installAsShutdownHook(LOG);
 
+        Configuration dynamicConfiguration =
+                
ConfigurationUtils.createConfiguration(cliOptions.getDynamicConfigs());
         DefaultContext defaultContext =
-                DefaultContext.load(
-                        
ConfigurationUtils.createConfiguration(cliOptions.getDynamicConfigs()),
-                        Collections.emptyList(),
-                        true,
-                        true);
+                DefaultContext.load(dynamicConfiguration, 
Collections.emptyList(), true, true);
         SqlGateway gateway =
                 new SqlGateway(
                         defaultContext.getFlinkConfig(), 
SessionManager.create(defaultContext));
+
+        final Configuration flinkConfiguration = 
GlobalConfiguration.loadConfiguration();
+        flinkConfiguration.addAll(dynamicConfiguration);
+
         try {
+            SecurityUtils.install(new 
SecurityConfiguration(flinkConfiguration));
+            SecurityUtils.getInstalledContext().runSecured(gateway::start);
             Runtime.getRuntime().addShutdownHook(new ShutdownThread(gateway));
             gateway.start();

Review Comment:
   SecurityUtils.getInstalledContext().runSecured(gateway::start);
   and 
   gateway.start();
   it will start twice.
   gateway.start() should be remove, 
   Runtime.getRuntime().addShutdownHook(new ShutdownThread(gateway)); should 
before SecurityUtils.getInstalledContext().runSecured(gateway::start);



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