Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-69520

Potential deadlock while shutting down portal

Details

    Description

      After we made MultiVMPoolUtil wait for real service (see https://github.com/liferay/liferay-portal/commit/d2d4a1b29b2df0ba449963f873d55f0dba710b5b), it is possible that deadlock comes up while shutting down, see deadlock-threaddump.txt.

      The solution is to switch the order of closing module framework and spring context, so that the real service is existed for sure when spring context is closing. MultiVMPoolUtil is only one of those Util who waits for real service, it is possible that other usages cause deadlock too, so we choose this solution in order to fix all the potential bugs.

      Steps to reproduce:
      1) Set break point at MultiVMEhcachePortalCacheManager.deactivate() and LAST Line of AssetCategoryPersistenceImpl.destroy().
      2) Start port in debug mode and connect to debugger
      3) Shutdown portal and wait for two break points are hit
      4) Let AssetCategoryPersistenceImpl.destroy() process and you will be deadlocked

      After fix, two break points won't be hit at the the same time.

      Attachments

        Activity

          People

            linda.sui Linda Sui
            tina.tian Tina Tian
            Kiyoshi Lee Kiyoshi Lee
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              5 years, 51 weeks, 2 days ago

              Packages

                Version Package
                7.0.0 DXP FP9
                7.0.0 DXP SP2
                7.0.3 CE GA4
                7.1.X
                Master