Skip to content

[JENKINS-69424] whitelist java.util.concurrent.atomic.AtomicInteger in pipelines #236

Description

@jenkins-infra-bot

Please whitelist java.util.concurrent.atomic.AtomicInteger, currently this must be approved explicitly otherwise a

def cnt = new java.util.concurrent.atomic.AtomicInteger(42)

results in

org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use new java.util.concurrent.atomic.AtomicInteger int

Rationale for using this is ensuring there are no concurrency issues when using parallel pipeline stages. The curent implementation of the Jenkins pipeline may not have concurrency issues, but that could change in the future and parallel code should be written in a proper way no to make assumptions


Originally reported by axelh, imported from: whitelist java.util.concurrent.atomic.AtomicInteger in pipelines
  • assignee: vjuranek
  • status: Open
  • priority: Minor
  • component(s): groovy-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 20260604-161841
Raw content of original issue

Please whitelist java.util.concurrent.atomic.AtomicInteger, currently this must be approved explicitly otherwise a

def cnt = new java.util.concurrent.atomic.AtomicInteger(42)

results in

org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use new java.util.concurrent.atomic.AtomicInteger int

Rationale for using this is ensuring there are no concurrency issues when using parallel pipeline stages. The curent implementation of the Jenkins pipeline may not have concurrency issues, but that could change in the future and parallel code should be written in a proper way no to make assumptions

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions