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

SpringRegisterableItemsFactory.processHandlers() should be synchronized

XMLWordPrintable

    • NEW
    • NEW
    • 2019 Week 14-16

      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();
                  }
              }
          }
      }
      

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

                Created:
                Updated:
                Resolved: