Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-8413

SpringRegisterableItemsFactory.processHandlers() should be synchronized

    XMLWordPrintable

Details

    • NEW
    • NEW
    • 2019 Week 14-16

    Description

      SpringRegisterableItemsFactory.processHandlers() should only be called once.

      However, under certain conditions (PER_REQUEST runtime strategy, high load), it can happen that the method is called concurrently by different threads leading to race conditions.

      Possible fix:

      private volatile Object initialized = null;
      
      protected void processHandlers() {
          Object result = initialized;
          if (result == null) {
              synchronized (this) {
                  if (initialized == null) {
                      [....]
                      initialized = new Object();
                  }
              }
          }
      }
      

      Attachments

        Activity

          People

            swiderski.maciej Maciej Swiderski (Inactive)
            btison Bernard Tison
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: