Skip to content

Walkthrough: Parallel User scanning at Jenkins Startup #27059

Description

@rajat315315

What feature do you want to see added?

Description

During Jenkins startup (Milestone: JOB_CONFIG_ADAPTED), the controller executes the initialization task AllUsers.scanAll() to index all registered user accounts. This task sequentially scans all user folders and parses their XML configurations (config.xml) using XStream.

For instances with large user databases (e.g. 20,000+ users), this sequential execution blocks startup, incurring substantial disk I/O and CPU serialization latency.

Proposed Changes

Parallelize User.scanAll() scanning and XML unmarshaling loop using Java Parallel Streams (Arrays.stream().parallel()). Since the user registry cache (byName) is a ConcurrentHashMap, insertions are thread-safe and scale efficiently on multi-core systems.

Upstream changes

No response

Are you interested in contributing this feature?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions