[JENKINS-71950] List plugins in deterministic order #8453
Merged
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.
I am aware of a case where the same set of plugins would lead to one controller starting successfully and one controller failing to start, depending on the order in which the plugins were listed. We currently use file system iteration order, which is undefined. This PR sorts the list by filename before passing the result to the topological sorting function, so every controller with the same set of plugins will now load them in the same order. This should make it easier to debug such problems, because they will either always occur, or they will never occur — but at least the behavior will be deterministic.
Testing done
I added a log statement to print the list of active plugins as consumed by the
UberClassLoader
and verified that at each level of the topological sort the entries were in lexicographical order.Proposed changelog entries
List plugins in deterministic order to improve diagnosability of plugin linkage errors.
Proposed upgrade guidelines
N/A
Submitter checklist
Desired reviewers
@mention
Before the changes are marked as
ready-for-merge
:Maintainer checklist