Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-15345

Dynamic Deployment of Models can cause a stack overlow error that causes excessive logging

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 3.0, 4.0, 5.0
    • Fix Version/s: 5.1.1
    • Component/s: Content Modelling
    • Labels:

      Description

      Summary

      Internal testing exposed this issue. When using Dynamic deployment of models if you deploy models that define namespaces and imports in a certain(unsupported) way it causes an error when attempting to update the cache due to a stack overflow error that is written endlessly in the logs at a rate of hundreds of times a second bogging down the server and filling the log file at a very fast rate.

      Steps to Reproduce

      • Upload attached testModel.xml into Company Home/Data Dictionary/Models
      • Edit properties and mark the testModel.xml as active
      • Upload attached testModel2.xml into Company Home/Data Dictionary/Models
      • Edit properties and mark the testModel2.xml as active
      • At this point Alfresco becomes unresponsive and the following is written to the logs over and over
        2015-12-03 11:52:21,562 ERROR [org.alfresco.util.cache.AbstractAsynchronouslyRefreshedCache] [asynchronouslyRefreshedCacheThreadPool1] Cache update failed: AbstractAsynchronouslyRefreshedCache [cacheId=compiledModelsCache]
        org.alfresco.error.AlfrescoRuntimeException: 11030842 Exception in Transaction.
        	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:542)
        	at org.alfresco.repo.dictionary.DictionaryRepositoryBootstrap.onDictionaryInit(DictionaryRepositoryBootstrap.java:762)
        	at org.alfresco.repo.dictionary.CoreDictionaryRegistryImpl.initImpl(CoreDictionaryRegistryImpl.java:34)
        	at org.alfresco.repo.dictionary.AbstractDictionaryRegistry.init(AbstractDictionaryRegistry.java:658)
        	at org.alfresco.repo.dictionary.DictionaryDAOImpl.createCoreDictionaryRegistry(DictionaryDAOImpl.java:183)
        	at org.alfresco.repo.dictionary.DictionaryDAOImpl.access$100(DictionaryDAOImpl.java:61)
        	at org.alfresco.repo.dictionary.DictionaryDAOImpl$2.doWork(DictionaryDAOImpl.java:726)
        	at org.alfresco.repo.dictionary.DictionaryDAOImpl$2.doWork(DictionaryDAOImpl.java:720)
        	at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:548)
        	at org.alfresco.repo.dictionary.DictionaryDAOImpl.initDictionaryRegistry(DictionaryDAOImpl.java:718)
        	at org.alfresco.repo.dictionary.CompiledModelsCache$1.doWork(CompiledModelsCache.java:51)
        	at org.alfresco.repo.dictionary.CompiledModelsCache$1.doWork(CompiledModelsCache.java:48)
        	at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:548)
        	at org.alfresco.repo.dictionary.CompiledModelsCache.buildCache(CompiledModelsCache.java:47)
        	at org.alfresco.repo.dictionary.CompiledModelsCache.buildCache(CompiledModelsCache.java:31)
        	at org.alfresco.util.cache.AbstractAsynchronouslyRefreshedCache.doRefresh(AbstractAsynchronouslyRefreshedCache.java:470)
        	at org.alfresco.util.cache.AbstractAsynchronouslyRefreshedCache.doCall(AbstractAsynchronouslyRefreshedCache.java:455)
        	at org.alfresco.util.cache.AbstractAsynchronouslyRefreshedCache.call(AbstractAsynchronouslyRefreshedCache.java:420)
        	at org.alfresco.util.cache.AbstractAsynchronouslyRefreshedCache.call(AbstractAsynchronouslyRefreshedCache.java:47)
        	at java.util.concurrent.FutureTask.run(Unknown Source)
        	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        	at java.lang.Thread.run(Unknown Source)
        Caused by: java.lang.StackOverflowError
        	at java.util.Collections$UnmodifiableCollection$1.<init>(Unknown Source)
        	at java.util.Collections$UnmodifiableCollection.iterator(Unknown Source)
        	at org.alfresco.repo.dictionary.DictionaryRepositoryBootstrap.loadModel(DictionaryRepositoryBootstrap.java:544)
        
      • Force killing the Alfresco process is the only way to stop it once this occurs
      • Attempting to restart the process ends in an error and Alfresco can no longer start properly

      Current Behavior
      Dynamic deployment of models can be done in a way that causes Alfresco to log extensively and essentially bring down the server.

      Expected Behavior
      Dynamic Deployment of models can not be performed in a way that crashes Alfresco and prevents it from starting up

      Additional Information
      When reproducing this issue my log file grew to over 1gb in less than a minute. The majority of the repeated logging is "at org.alfresco.repo.dictionary.DictionaryRepositoryBootstrap.loadModel(DictionaryRepositoryBootstrap.java:553)" literally thousands of times every time the cache error is thrown.

        Attachments

        1. testModel.xml
          0.8 kB
        2. testModel2.xml
          0.8 kB

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  closedbugs Closed Bugs (Inactive)
                  Reporter:
                  thines Trevor Hines
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 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 - 1 day, 4 hours, 15 minutes
                    1d 4h 15m

                      Structure Helper Panel