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

non-atomic operations on volatile field inspection - hudson.model.UpdateSite.isDue

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None
    • Jenkins 2.181

      IntelliJ IDEA 2019.1.2 (Ultimate Edition)
      Build #IU-191.7141.44, built on May 7, 2019
      JRE: 1.8.0_202-release-1483-b49 x86_64
      JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
      macOS 10.14.4

      Steps:

      1. Open hudson.model.UpdateSite (.java) in IntelliJ
      2. Analyze > Inspect Code...
      3.  File ...UpdateSite.java
      4. OK

      Actual results

      non-atomic operations on volatile field inspection

      Reports any non-atomic operations on volatile fields. Non-atomic operations on volatile fields are operations where the field is read and the value is used to update the field. It is possible for the value of the field to change between the read and the write, possibly invalidating the operation. The non-atomic operation can be avoided by surrounding it with a synchronized block or by making use of one of the classes from the java.util.concurrent.atomic package.

      ~~~~~~~~~~~~~~~~~~~~~~~~
                  retryWindow = Math.max(retryWindow,SECONDS.toMillis(15));
      ~~~~~~~~~~~~~~~~~~~~~~~~
                  lastAttempt = now;
                  retryWindow = Math.min(retryWindow*2, HOURS.toMillis(1)); // exponential back off but at most 1 hour
              }
      ~~~~~~~~~~~~~~~~~~~~~~~~

            jsoref Josh Soref
            jsoref Josh Soref
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: