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

Race condition in GenericFacesPortlet.isAutoDispatchEvents() method

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 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
    • Labels:
      None

      Description

      The GenericFacesPortlet.isAutoDispatchEvents() method does lazy initialization like the following:

      GenericFacesPortlet.java
      public boolean isAutoDispatchEvents() {
      
      	if (autoDispatchEvents == null) {
      		...
      	}
      	return autoDispatchEvents;
      }
      

      Since isAutoDispatchEvents() method is called from the processEvent(EventRequest,EventResponse) method, a race condition for initialization can arise if two event requests arrive at the same time.

      The solution is to ensure that the autoDispatchEvents private data member is initialized when GenericFacesPortlet.init(PortletConfig) is called.

        Attachments

          Activity

            People

            • Assignee:
              neil.griffin Neil Griffin
              Reporter:
              neil.griffin Neil Griffin
              Participants of an Issue:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package
                bridge-api-2.0.0
                bridge-api-3.0.0
                bridge-api-4.0.0