-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release class loader when a plugin fails to load #6030
Conversation
This PR was tested successfully in a passing Windows CI run in #6024. |
@@ -928,9 +931,10 @@ public void dynamicLoad(File arc, boolean removeExisting, @CheckForNull List<Plu | |||
} | |||
|
|||
} catch (Exception e) { | |||
failedPlugins.add(new FailedPlugin(sn, e)); | |||
failedPlugins.add(new FailedPlugin(p, e)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jenkins/core/src/main/java/hudson/PluginManager.java
Lines 2270 to 2286 in 165d559
/** | |
* Constructor for FailedPlugin when we do not have an associated PluginWrapper | |
*/ | |
public FailedPlugin(String name, Exception cause) { | |
this.name = name; | |
this.cause = cause; | |
this.pluginWrapper = null; | |
} | |
/** | |
* Constructor for FailedPlugin when we know which PluginWrapper failed | |
*/ | |
public FailedPlugin(PluginWrapper pluginWrapper, Exception cause) { | |
this.name = pluginWrapper.getShortName(); | |
this.cause = cause; | |
this.pluginWrapper = pluginWrapper; | |
} |
This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback. Please see the merge process documentation for more information about the merge process. Thanks! |
A minor bug I noticed while debugging some Windows test issues. When a plugin is successfully loaded, we properly release its class loader in
PluginManager#stop
, but we never do the same when a plugin fails to load. This is a legitimate (though minor) leak.Proposed changelog entries
Proposed upgrade guidelines
N/A
Submitter checklist
Proposed changelog entries
section only if there are breaking changes or other changes which may require extra steps from users during the upgradeDesired reviewers
@mention
Maintainer checklist
Before the changes are marked as
ready-for-merge
:Proposed changelog entries
are correctupgrade-guide-needed
label is set and there is aProposed upgrade guidelines
section in the PR title. (example)lts-candidate
to be considered (see query).