Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-18737

Low heap memory error in yum metadata rebuild

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.14.0
    • Fix Version/s: 3.16.0
    • Component/s: Yum

      Description

      Yum metadata rebuild in response to   "YumMetadataInvalidationEvent" can fail with a low heap memory error.  In this particular case, the user had 4Gb of heap space, which should have been plenty, since the repository in question does not appear to have more than about 60 rpm files in it.

      Initial analysis suggests this is happening because the transaction is being kept open for for the entire metadata write process, and this process can perform many other orient transactions while it is running.

      2018-12-20 13:24:42,653+0000 ERROR [event-6-thread-930] jenkins com.google.common.eventbus.EventBus.nexus.async - Could not dispatch event org.sonatype.nexus.repository.yum.internal.createrepo.YumMetadataInvalidationEvent@666f61a5 to subscriber org.sonatype.nexus.repository.yum.internal.createrepo.CreateRepoFacetImpl$$EnhancerByGuice$$37dcd9ba@5837aefd method [public void org.sonatype.nexus.repository.yum.internal.createrepo.CreateRepoFacetImpl.on(org.sonatype.nexus.repository.yum.internal.createrepo.YumMetadataInvalidationEvent)]
      com.orientechnologies.orient.core.exception.ODatabaseException: Error on command execution
      DB name="component"
      at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.command(ODatabaseDocumentTx.java:746)
      at org.sonatype.nexus.repository.storage.AssetEntityAdapter.exists(AssetEntityAdapter.java:371)
      at org.sonatype.nexus.repository.storage.StorageTxImpl.assetExists(StorageTxImpl.java:422)
      at sun.reflect.GeneratedMethodAccessor456.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.sonatype.nexus.common.stateguard.SimpleMethodInvocation.proceed(SimpleMethodInvocation.java:53)
      at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
      at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:272)
      at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:53)
      at org.sonatype.nexus.common.stateguard.StateGuardAspect$1.invoke(StateGuardAspect.java:63)
      at com.sun.proxy.$Proxy233.assetExists(Unknown Source)
      at org.sonatype.nexus.repository.yum.internal.createrepo.CreateRepoServiceImpl.rpmExists(CreateRepoServiceImpl.java:610)
      at org.sonatype.nexus.repository.yum.internal.createrepo.CreateRepoServiceImpl.lambda$2(CreateRepoServiceImpl.java:580)
      at org.sonatype.nexus.repository.yum.internal.createrepo.MetadataWriter.copyFromXml(MetadataWriter.java:198)
      at org.sonatype.nexus.repository.yum.internal.createrepo.CreateRepoServiceImpl.writeToPrimaryUsingCache(CreateRepoServiceImpl.java:577)
      at org.sonatype.nexus.repository.yum.internal.createrepo.CreateRepoServiceImpl.appendCachedEntries(CreateRepoServiceImpl.java:530)
      at org.sonatype.nexus.repository.yum.internal.createrepo.CreateRepoServiceImpl.writeMetadata(CreateRepoServiceImpl.java:469)
      at org.sonatype.nexus.repository.yum.internal.createrepo.CreateRepoServiceImpl.convertDirectoriesToMetadata(CreateRepoServiceImpl.java:180)
      at org.sonatype.nexus.repository.yum.internal.createrepo.CreateRepoServiceImpl.buildMetadata(CreateRepoServiceImpl.java:150)
      at org.sonatype.nexus.repository.yum.internal.createrepo.CreateRepoServiceImpl.buildMetadata(CreateRepoServiceImpl.java:134)
      at org.sonatype.nexus.repository.yum.internal.createrepo.CreateRepoServiceImpl.buildMetadataUsingCaching(CreateRepoServiceImpl.java:120)
      at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:56)
      at org.sonatype.nexus.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:54)
      at org.sonatype.nexus.repository.yum.internal.createrepo.CreateRepoFacetImpl.buildMetadata(CreateRepoFacetImpl.java:190)
      at org.sonatype.nexus.repository.yum.internal.createrepo.CreateRepoFacetImpl.on(CreateRepoFacetImpl.java:175)
      at sun.reflect.GeneratedMethodAccessor416.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:87)
      at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:144)
      at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:72)
      at org.sonatype.nexus.thread.internal.MDCAwareRunnable.run(MDCAwareRunnable.java:40)
      at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120)
      at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
      Caused by: com.orientechnologies.orient.core.exception.OCommandExecutionException: Cannot execute query "select from index:asset_bucket_name_idx where key = [:bucket, :name]": low heap memory
      DB name="component"
      at com.orientechnologies.orient.core.sql.OSoftQueryResultList.throwCanExecuteException(OSoftQueryResultList.java:688)
      at com.orientechnologies.orient.core.sql.OSoftQueryResultList.checkQueue(OSoftQueryResultList.java:78)
      at com.orientechnologies.orient.core.sql.OSoftQueryResultList.clear(OSoftQueryResultList.java:346)
      at java.util.Collections$SynchronizedCollection.clear(Collections.java:2054)
      at com.orientechnologies.orient.core.sql.query.OBasicResultSet.clear(OBasicResultSet.java:154)
      at com.orientechnologies.orient.core.sql.query.OSQLSynchQuery.reset(OSQLSynchQuery.java:66)
      at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.command(ODatabaseDocumentTx.java:742)
      ... 37 common frames omitted

       

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              natemcafee Nate McAfee
              Reporter:
              rseddon Rich Seddon
              Last Updated By:
              Peter Lynch Peter Lynch
              Team:
              NXRM - Cypher
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title