Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-23259

Fix thread-safety issue in MongoDB directory initialization

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 9.3-SNAPSHOT
    • Fix Version/s: 9.3
    • Component/s: Core MongoDB, Directory

      Description

      During reference benchmark (create or update doc) there are NPE during directory access, this creates errors and when it happends during job deserialization this corrupts the workmanager metrics, this prevent to wait for async work and get benchmark results.

      2017-10-04 11:36:50,400 ERROR [Nuxeo-Work-default-2] [org.nuxeo.ecm.core.work.WorkManagerImpl] Uncaught error on thread: Nuxeo-Work-default-2, current work might be lost, WorkManager metrics might be corrupted.
      java.lang.NullPointerException
             at org.nuxeo.ecm.directory.BaseSession.getEntryFromSource(BaseSession.java:347)
             at org.nuxeo.ecm.directory.DirectoryCache.getEntry(DirectoryCache.java:121)
             at org.nuxeo.ecm.directory.BaseSession.getEntry(BaseSession.java:334)
             at org.nuxeo.ecm.directory.BaseSession.getEntry(BaseSession.java:322)
             at org.nuxeo.ecm.platform.usermanager.UserManagerImpl.getUserModel(UserManagerImpl.java:1129)
             at org.nuxeo.ecm.platform.usermanager.UserManagerImpl.getPrincipal(UserManagerImpl.java:1164)
             at org.nuxeo.ecm.platform.usermanager.UserManagerImpl.getPrincipalUsingCache(UserManagerImpl.java:582)
             at org.nuxeo.ecm.platform.usermanager.UserManagerImpl.getPrincipal(UserManagerImpl.java:574)
      

      Note that the stack trace can be hidden depending on JVM optimization:

      2017-10-04 10:10:09,276 ERROR [Nuxeo-Work-default-4] [org.nuxeo.ecm.core.work.WorkManagerImpl] Uncaught error on thread: Nuxeo-Work-default-4, current work might be lost, WorkManager metrics might be corrupted.
      java.lang.NullPointerException
      

      The stack can be enable using the JVM option: -XX:-OmitStackTraceInFastThrow.

      Before the NPE there is also other error from the usermanager:

      2017-10-04 10:07:33,223 ERROR [http-bio-0.0.0.0-8080-exec-37] [org.nuxeo.ecm.platform.usermanager.UserManagerImpl] Trying to authenticate against a non authenticating directory: userDirectory
      

      This happens only 20 times during the benchmarks.
      the nuxeo templates used are mongodb,default.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h