perf: parallelize user directory scanning and XML unmarshaling at sta…#27063
perf: parallelize user directory scanning and XML unmarshaling at sta…#27063rajat315315 wants to merge 3 commits into
Conversation
|
Please complete the "testing done" section of the pull request template. The comment says:
Please explain why you checked the box for "has automated tests" but only changed production code, without adding an automated test. |
There was a problem hiding this comment.
Pull request overview
This pull request speeds up Jenkins startup user indexing by parallelizing the on-disk user directory scan and config.xml unmarshaling performed in hudson.model.User.AllUsers#scanAll.
Changes:
- Switch user directory iteration from a sequential
forloop to a parallel stream. - Preserve existing per-user failure handling behavior (skip invalid directories / missing or unreadable
config.xml/ invalid IDs) while allowing other users to load concurrently.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
MarkEWaite
left a comment
There was a problem hiding this comment.
Thanks for the pull request.
Please complete the "testing done" section of the pull request description. Include a description of the interactive testing you performed to assure that the change is ready for large scale use.
Please provide one or more automated tests that address the concerns raised in the GitHub Copilot review of the pull request.
…onfiguration files
|
I created an installation with over 40000 users with the following script in the Groovy script console: I saw no issues starting with that many users. The "Manage Jenkins" / "Users" page is slow to render because it does not use pagination to limit the number of rows shown to the user, but that is a pre-existing condition that is not changed by this pull request. |
… to prevent thread pool exhaustion
Description
This PR parallelizes user index initialization during startup inside
hudson.model.User$AllUsers#scanAll.Benefits
ConcurrentHashMap(byName) for concurrent index registrations.Micro-benchmark Results (3,000 users, 10 iterations)
Fixes #27059
Testing done
I have added an automated test
parallelScanAllWithMalformedConfig()thatthat verifies the behavior of
User.AllUsers.scanAll().config.xmlfiles inside distinct directories:User.AllUsers.scanAll().finallyblock.Screenshots (UI changes only)
Before
After
Proposed changelog entries
parallelize user directory scanning and XML unmarshaling at startup
Proposed changelog category
/label major-rfe
Proposed upgrade guidelines
N/A
Submitter checklist
@Restrictedor have@since TODOJavadocs, as appropriate.@Deprecated(since = "TODO")or@Deprecated(forRemoval = true, since = "TODO"), if applicable.evalto ease future introduction of Content Security Policy (CSP) directives (see documentation).Desired reviewers
@mention
Before the changes are marked as
ready-for-merge:Maintainer checklist
upgrade-guide-neededlabel is set and there is a Proposed upgrade guidelines section in the pull request title (see example).lts-candidateto be considered.