Affects Version/s: 7.0.0 DXP SP2, Master
If the browser ever sends simultaneous requests to the JVM that require the JVM to look up a struts path, and the _portletIdsByStrutsPath inside of PortletLocalServiceImpl has not been populated yet, then a race condition occurs that results in one of two things happening, depending on the delay between the threads:
1) Each of the threads detects that _portletIdsByStrutsPath is empty, and tries to populate it simultaneously. This results in all but one of the threads outputting "Duplicate struts path" warning messages to the logs.
2) One of the threads starts populating _portletIdsByStrutsPath before the other threads check whether or not it is empty. This potentially results in a NullPointerException, and possibly more sinister behavior, because if the first thread has not yet added the struts path to the map that the other threads are trying to look up, then the other threads will all return null and they will not perform the request that the browser asked of them (the consequence of this depends on the portlet).
Steps to reproduce
I do not have steps to reproduce in master because I am not aware of any portlets in master that result in multiple struts path requests being fired off simultaneously. If someone knows of a portlet that does this, or can create a custom one that does this, then please let me know and we can update the steps to reproduce accordingly.
This issue can be tested in ee-7.0.x by taking the following steps:
1. Use a fresh database and start the server.
2. Add several categories to the Topic (Global) vocabulary and the Topic (Liferay DXP) vocabulary.
3. Add an asset publisher to a page on the Liferay DXP site.
4. Navigate to Control Panel > Configuration > Server Administration and run the following Groovy script:
5. Go back to the page with the Asset Publisher, open the asset publisher's configuration, and add a filter by categories.
6. Click "Select" to choose a category.
Expected results: No error messages appear in the logs and everything works normally.
Actual results: Either one of two things happen. Most of the time, you will see a "Duplicate struts path" warning message in the log for every portlet that is deployed (upwards of 200 messages). When this happens, the UI loads normally and everything is fine. However, occasionally, you will instead see the following stack trace in the logs:
When this happens, one of the Vocabularies will be collapsed, and you have to expand it to see its Categories.
You can quickly retest this issue by repeating steps 4-6. Just have one tab open in the Groovy console clicking "Execute", and have the other tab on the Asset Publisher's configuration clicking "Select"
Reproduced in ee-7.0.x (9fb91fcd8afc186172652024997a42fee6fd6787)
Cannot test in master because we are not aware of any portlets that cause simultaneous requests to be sent to the JVM. If anyone knows of such a portlet or can make a custom one, let me know and we can update the steps to reproduce accordingly. However, from looking at the code, this issue exists in master.