[JENKINS-66993] Do not register AntClassLoader
as parallel-capable
#5865
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Steps to reproduce
See JENKINS-66993.
java -jar jenkins.war
.java -jar jenkins.war
.Expected results
The page loads without errors.
Actual results
The credentials portions of the page fail to load and the following is logged:
Stack trace
Evaluation
This is a regression introduced in 2.309 by registering
AntClassLoader
as parallel-capable. When the call toregisterAsParallelCapable()
is removed fromjenkins.util.AntClassLoader
, the problem can no longer be reproduced. The problem also cannot be reproduced when using the experimental support forURLClassLoader2
introduced in 2.310, even though this is registered as parallel-capable.Note that registering
AntClassLoader
as parallel-capable was an upstream change made on September 21, 2016. We suspect the upstream change was made in error, as the implementation is still usingsynchronized
methods rather thangetClassLoadingLock
.Short-term solution (this PR)
Restore the status quo by no longer registering
AntClassLoader
(or its subclassPluginFirstClassLoader
) as parallel-capable. With this change, the problem can no longer be reproduced. This is intended to ensure stability for the forthcoming 2.31x LTS release.Long-term solution (not this PR)
Once the 2.31x LTS release is shipped, we plan to continue the work to make
URLClassLoader2
the default class loader with the goal of deprecating and eventually deleting usages ofAntClassLoader
. This change requires more testing and is not appropriate for the forthcoming 2.31x LTS release; however, it would be appropriate to land such a change at the beginning of a new LTS cycle once enough users have upgraded to recent versions of the Bouncy Castle API plugin (a prerequisite for the use ofURLClassLoader2
).Proposed changelog entries
LinkageError
during class loading (regression in 2.309).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).