Uploaded image for project: 'Repository'
  1. Repository
  2. REPO-3252

LicenseComponent can stop repo bootstrap if fails to get job lock

    Details

    • Bug Priority:
      Category 2
    • Work Funnel:
      Architecture
    • Sprint:
      Repository Sprint 23
    • Story Points:
      2
    • Work Funnel End:
      2018-02

      Description

      If 2 node cluster is started up simultaneously one of the nodes might fail to bootstrap with the following exception:

      alfresconode1_1  | 2018-02-02 11:18:22,895  ERROR [web.context.ContextLoader] [localhost-startStop-1] Context initialization failed
      alfresconode1_1  | org.alfresco.repo.lock.LockAcquisitionException: 01020028 Failed to get lock '{http://www.alfresco.org/model/content/1.0}verifylicense' using token '3ab9ab5e-076c-4d54-bdbc-6837d1e2300f'.  An exclusive lock exists: LockEntity[ ID=1, sharedResourceId=1, exclusiveResourceId=1]
      alfresconode1_1  | 	at org.alfresco.repo.domain.locks.AbstractLockDAOImpl.getLock(AbstractLockDAOImpl.java:120)
      alfresconode1_1  | 	at org.alfresco.repo.lock.JobLockServiceImpl$5.execute(JobLockServiceImpl.java:494)
      alfresconode1_1  | 	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:464)
      alfresconode1_1  | 	at org.alfresco.repo.lock.JobLockServiceImpl.doWithRetry(JobLockServiceImpl.java:546)
      alfresconode1_1  | 	at org.alfresco.repo.lock.JobLockServiceImpl.getLockImpl(JobLockServiceImpl.java:500)
      alfresconode1_1  | 	at org.alfresco.repo.lock.JobLockServiceImpl.getLock(JobLockServiceImpl.java:228)
      alfresconode1_1  | 	at org.alfresco.repo.lock.JobLockServiceImpl.getLock(JobLockServiceImpl.java:218)
      alfresconode1_1  | 	at org.alfresco.repo.lock.JobLockServiceImpl.getLock(JobLockServiceImpl.java:288)
      alfresconode1_1  | 	at org.alfresco.enterprise.license.LicenseComponent.verifyLicense(LicenseComponent.java:134)
      alfresconode1_1  | 	at org.alfresco.repo.descriptor.DescriptorServiceImpl.bootstrap(DescriptorServiceImpl.java:382)
      alfresconode1_1  | 	at org.alfresco.repo.descriptor.DescriptorServiceImpl.access$7(DescriptorServiceImpl.java:328)
      alfresconode1_1  | 	at org.alfresco.repo.descriptor.DescriptorServiceImpl$5.doWork(DescriptorServiceImpl.java:318)
      alfresconode1_1  | 	at org.alfresco.repo.descriptor.DescriptorServiceImpl$5.doWork(DescriptorServiceImpl.java:1)
      alfresconode1_1  | 	at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:555)
      alfresconode1_1  | 	at org.alfresco.repo.descriptor.DescriptorServiceImpl.onBootstrap(DescriptorServiceImpl.java:322)
      alfresconode1_1  | 	at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
      alfresconode1_1  | 	at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEventInternal(SafeApplicationEventMulticaster.java:214)
      alfresconode1_1  | 	at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:185)
      alfresconode1_1  | 	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
      alfresconode1_1  | 	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:954)
      alfresconode1_1  | 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
      alfresconode1_1  | 	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
      alfresconode1_1  | 	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
      alfresconode1_1  | 	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
      alfresconode1_1  | 	at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:70)
      alfresconode1_1  | 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745)
      alfresconode1_1  | 	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)
      alfresconode1_1  | 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      alfresconode1_1  | 	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
      alfresconode1_1  | 	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
      alfresconode1_1  | 	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
      alfresconode1_1  | 	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1144)
      alfresconode1_1  | 	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1878)
      alfresconode1_1  | 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      alfresconode1_1  | 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      alfresconode1_1  | 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      alfresconode1_1  | 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      alfresconode1_1  | 	at java.lang.Thread.run(Thread.java:748)
      

      The proposed solution is to wrap job lock acquisition code into RetryingTransactionHelper.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                amukha Alex Mukha
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: