morningman commented on code in PR #70338:
URL: https://github.com/apache/doris/pull/70338#discussion_r4574165004
##########
fe/fe-core/src/main/java/org/apache/doris/connector/ConnectorPluginManager.java:
##########
@@ -314,9 +332,21 @@ public void loadPlugins(List<Path> pluginRoots) {
runtimeManager.discard(handle.getPluginName());
continue;
}
+ ConnectorProvider provider = handle.getFactory();
+ // Snapshot the security surface before publishing anything: it is
plugin code, a connector may
+ // build it through its own ServiceLoader, and one bad plugin dir
must not stop FE.
+ ConnectorSecuritySurface securitySurface;
+ try {
+ securitySurface = provider.securitySurface();
+ } catch (RuntimeException | LinkageError e) {
Review Comment:
Thanks. The mechanism is right, but it exists only on a broken test
classpath, so I'm keeping the builtin catch as it is.
In production Hive, Iceberg and Paimon are never builtins: fe-core depends
on them in test scope only, and FE loads them from `plugins/connector/`, one
loader per plugin. `MetaStoreProviders` is not on FE's classpath (fe-core does
not depend on `fe-connector-metastore-spi`), so each plugin defines its own
copy, a failed static initializer cannot reach another provider, and the
directory path's catch already includes `LinkageError`.
The two catches follow `FileSystemPluginManager`: its `loadBuiltins` catches
`RuntimeException` around a provider's `sensitivePropertyKeys()`, and its
directory path adds `LinkageError`. On the classpath, a descriptor naming a
missing backend is a build defect, and a `LinkageError` there already stops
startup elsewhere, for example from `ServiceLoader`'s `hasNext()` when a
provider class does not link. Here the first provider is skipped and logged,
and the second stops startup with a `NoClassDefFoundError` naming the class
whose initializer failed, which points at the defect.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]