Uploaded image for project: 'PUBLIC - Liferay Faces'
  1. PUBLIC - Liferay Faces
  2. FACES-2006

BridgeFactoryFinderImpl not thread safe

    Details

      Description

      The method "getFactoryInstance" of BridgeFactoryFinderImpl is used in a multithreaded context and is not thread safe.

      The instance variable bridgeFactoryCache is a HashMap which is not thread safe.

      We see that the map is not immutable :

      public FactoryWrapper<?> getFactoryInstance(Class<? extends FactoryWrapper<?>> clazz)
      {
      FactoryWrapper factory = null;

      if (clazz != null)
      {
      factory = (FactoryWrapper)this.bridgeFactoryCache.get(clazz);

      if (factory == null) {
      factory = (FactoryWrapper)this.bridgeConfig.getAttributes().get(clazz.getName());

      if (factory != null)

      { this.bridgeFactoryCache.put(clazz, factory); }

      }
      }

      return factory;
      }

      This can cause stuck threads and a downtime of the server.
      "[STUCK] ExecuteThread: '101' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=3 tid=0x00000001136e3000 nid=0x1411 runnable [0xffffffff16bf8000]
      java.lang.Thread.State: RUNNABLE
      at java.util.HashMap.get(HashMap.java:303)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              neil.griffin Neil Griffin
              Reporter:
              laurent.dullier Laurent Dullier
              Participants of an Issue:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Packages

                  Version Package
                  liferay-faces-2.1.5-ga6
                  liferay-faces-2.2.5-ga6
                  liferay-faces-3.0.5-legacy-ga6
                  liferay-faces-3.0.5-ga6
                  liferay-faces-3.1.5-ga6
                  liferay-faces-3.2.5-ga6
                  liferay-faces-4.2.5-ga6