mik-laj commented on a change in pull request #8732:
URL: https://github.com/apache/airflow/pull/8732#discussion_r420849958



##########
File path: airflow/plugins_manager.py
##########
@@ -135,19 +135,23 @@ def load_entrypoint_plugins():
     Load and register plugins AirflowPlugin subclasses from the entrypoints.
     The entry_point group should be 'airflow.plugins'.
     """
+    global import_errors  # pylint: disable=global-statement
     global plugins  # pylint: disable=global-statement
 
     entry_points = pkg_resources.iter_entry_points('airflow.plugins')
 
     log.debug("Loading plugins from entrypoints")
 
-    for entry_point in entry_points:
+    for entry_point in entry_points:  # pylint: disable=too-many-nested-blocks
         log.debug('Importing entry_point plugin %s', entry_point.name)
-        plugin_obj = entry_point.load()
-        if is_valid_plugin(plugin_obj):
-            if callable(getattr(plugin_obj, 'on_load', None)):
-                plugin_obj.on_load()
-                plugins.append(plugin_obj)
+        try:
+            plugin_obj = entry_point.load()
+            if is_valid_plugin(plugin_obj):
+                if callable(getattr(plugin_obj, 'on_load', None)):
+                    plugin_obj.on_load()
+                    plugins.append(plugin_obj)
+        except Exception:  # pylint: disable=broad-except
+            log.exception("Failed to import plugin %s", entry_point.name)

Review comment:
       Should we add it to import_errors - line 36? This will make this 
information available on the Web UI. I see you added global, but you haven't 
used the variable still.




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


Reply via email to