Seaven commented on a change in pull request #3267: [Bug] Fix some bugs of 
install/uninstall plugins
URL: https://github.com/apache/incubator-doris/pull/3267#discussion_r405924531
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/plugin/PluginMgr.java
 ##########
 @@ -86,25 +112,26 @@ public PluginInfo installPlugin(InstallPluginStmt stmt) 
throws IOException, User
 
         try {
             PluginInfo info = pluginLoader.getPluginInfo();
-
-            if (plugins[info.getTypeId()].containsKey(info.getName())) {
+            
+            if (checkDynamicPluginNameExist(info.getName())) {
                 throw new UserException("plugin " + info.getName() + " has 
already been installed.");
             }
             
             // install plugin
             pluginLoader.install();
             pluginLoader.setStatus(PluginStatus.INSTALLED);
             
-            if (plugins[info.getTypeId()].putIfAbsent(info.getName(), 
pluginLoader) != null) {
-                pluginLoader.uninstall();
+            if (!addDynamicPluginNameIfAbsent(info.getName())) {
                 throw new UserException("plugin " + info.getName() + " has 
already been installed.");
             }
-
+            
+            plugins[info.getTypeId()].put(info.getName(), pluginLoader);
+            
             Catalog.getCurrentCatalog().getEditLog().logInstallPlugin(info);
-            LOG.info("install plugin = " + info.getName());
+            LOG.info("install plugin {}", info.getName());
             return info;
         } catch (IOException | UserException e) {
-            pluginLoader.setStatus(PluginStatus.ERROR);
+            pluginLoader.uninstall();
 
 Review comment:
   Ignore, installPath will not exist if it is not installed

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to