github-actions[bot] commented on code in PR #67286:
URL: https://github.com/apache/doris/pull/67286#discussion_r3922803703
##########
fe/fe-extension-loader/src/main/java/org/apache/doris/extension/loader/ApiVersionGate.java:
##########
@@ -155,18 +196,28 @@ public int getExpectedMajor() {
/**
* Judges what a plugin jar declared.
*
- * <p>Fail-closed: a jar that declares nothing is rejected, so that a
plugin built without any awareness of
- * this contract cannot slip through. A third party can still get in by
declaring a version it was not
- * built against, but that is an active false claim rather than an
omission.
+ * <p>Strict gates reject a jar that declares nothing. A family that
explicitly configures a legacy
+ * unversioned version may accept an absent declaration when that legacy
major matches the FE. Blank,
+ * malformed, and explicitly incompatible declarations always remain
fail-closed.
*
* @param declaredVersion the value of {@link #getManifestAttribute()} in
the plugin jar, or null when absent
* @return null when the plugin may load, otherwise a diagnostic naming
the declared and expected values
*/
public String rejectionReason(String declaredVersion) {
- if (declaredVersion == null || declaredVersion.trim().isEmpty()) {
- return "no " + manifestAttribute + " in the plugin jar MANIFEST;
this FE serves " + familyLabel
- + " plugin API " + expectedVersion + ". Declare the
attribute and rebuild the plugin"
- + " against this Doris release.";
+ if (declaredVersion == null) {
Review Comment:
[P2] Distinguish an absent declaration from a failed manifest lookup
On the directory-loading path, null does not prove that a readable defining
JAR genuinely omitted this attribute. `readFromDefiningJar` also returns null
after every `JarFile`/manifest `IOException`, or when the fallback scan cannot
find the factory class. For example, lazy loading can define a self-contained
factory and then race a JAR removal or permission/read failure before the
separate manifest opens; this branch then admits and publishes the unverifiable
plugin as legacy 1.0. Preserve an explicit successfully-read-but-absent result
for this legacy case, reject unresolved/read failures at `STAGE_API_VERSION`,
and add a loader-level negative test alongside the true-absence case.
--
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]