Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-53724

EnvVars.masterEnvVars is widely used as a public collection without synchronization

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • core
    • None

      Originally discovered while fixing Illegal Reflective Access in EnvInject (CC jeffpearce).

       

      There are many usages of the field: https://github.com/search?q=org%3Ajenkinsci+%22masterEnvVars%22&type=Code . In many cases the collection is modified, but there is no synchronization in the code. So there is a risk of Concurrent modification exceptions

       

      I propose reworking the code, e.g. by introducing CopyOnWriteEnvVars or so which follows the same interface

       

            Unassigned Unassigned
            oleg_nenashev Oleg Nenashev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: