Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-11434

Pull Requests - Race condition between "delete source branch after merging" and the "automatic cascading merge"

    XMLWordPrintable

Details

    Description

      The "delete source branch after merging" and the "automatic cascading merge" compete with each other. 

      When the automatic cascading merge is set up, and the delete-source branch option is checked, delete-source-branch executes before the merge,  automatic-cascading-merge is not executed and the automatic merging fails with this error:

      Automatic merging failed for unknown reason
      {cause: null, commitId: refs/heads/release/release_1.1, keyedMessage:
      
      {key: bitbucket.service.pullrequest.nosuchref, localisedMessage: Repository "merge-test" of project with key "PROJ" has no branch "refs/heads/release/release_1.1", rootMessage: Repository "merge-test" of project with key "PROJ" has no branch "refs/heads/release/release_1.1"}
      , localizedMessage: Repository "merge-test" of project with key "PROJ" has no branch "refs/heads/release/release_1.1", message: Repository "merge-test" of project with key "PROJ" has no branch "refs/heads/release/release_1.1", messageKey: bitbucket.service.pullrequest.nosuchref, stackTrace: [
      
      {className: com.atlassian.stash.internal.pull.DefaultPullRequestService, fileName: DefaultPullRequestService.java, lineNumber: 1925, methodName: resolveRefOrFail, nativeMethod: false}
      ,
      
      {className: com.atlassian.stash.internal.pull.DefaultPullRequestService, fileName: DefaultPullRequestService.java, lineNumber: 343, methodName: create, nativeMethod: false}
      ,
      
      {className: com.atlassian.stash.internal.pull.DefaultPullRequestService, fileName: DefaultPullRequestService.java, lineNumber: 102, methodName: create, nativeMethod: false}
      ,
      
      {className: sun.reflect.NativeMethodAccessorImpl, fileName: NativeMethodAccessorImpl.java, lineNumber: -2, methodName: invoke0, nativeMethod: true}
      ,
      
      {className: sun.reflect.NativeMethodAccessorImpl, fileName: NativeMethodAccessorImpl.java, lineNumber: 62, methodName: invoke, nativeMethod: false}
      ,
      
      {className: sun.reflect.DelegatingMethodAccessorImpl, fileName: DelegatingMethodAccessorImpl.java, lineNumber: 43, methodName: invoke, nativeMethod: false}
      ,
      
      {className: java.lang.reflect.Method, fileName: Method.java, lineNumber: 498, methodName: invoke, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.support.AopUtils, fileName: AopUtils.java, lineNumber: 333, methodName: invokeJoinpointUsingReflection, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.framework.ReflectiveMethodInvocation, fileName: ReflectiveMethodInvocation.java, lineNumber: 190, methodName: invokeJoinpoint, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.framework.ReflectiveMethodInvocation, fileName: ReflectiveMethodInvocation.java, lineNumber: 157, methodName: proceed, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint, fileName: MethodInvocationProceedingJoinPoint.java, lineNumber: 85, methodName: proceed, nativeMethod: false}
      ,
      
      {className: com.atlassian.stash.internal.aop.ProfilingAspect, fileName: ProfilingAspect.java, lineNumber: 47, methodName: profileMethod, nativeMethod: false}
      ,
      
      {className: sun.reflect.GeneratedMethodAccessor413, fileName: null, lineNumber: -1, methodName: invoke, nativeMethod: false}
      ,
      
      {className: sun.reflect.DelegatingMethodAccessorImpl, fileName: DelegatingMethodAccessorImpl.java, lineNumber: 43, methodName: invoke, nativeMethod: false}
      ,
      
      {className: java.lang.reflect.Method, fileName: Method.java, lineNumber: 498, methodName: invoke, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.aspectj.AbstractAspectJAdvice, fileName: AbstractAspectJAdvice.java, lineNumber: 627, methodName: invokeAdviceMethodWithGivenArgs, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.aspectj.AbstractAspectJAdvice, fileName: AbstractAspectJAdvice.java, lineNumber: 616, methodName: invokeAdviceMethod, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.aspectj.AspectJAroundAdvice, fileName: AspectJAroundAdvice.java, lineNumber: 70, methodName: invoke, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.framework.ReflectiveMethodInvocation, fileName: ReflectiveMethodInvocation.java, lineNumber: 168, methodName: proceed, nativeMethod: false}
      ,
      
      {className: org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor, fileName: MethodSecurityInterceptor.java, lineNumber: 69, methodName: invoke, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.framework.ReflectiveMethodInvocation, fileName: ReflectiveMethodInvocation.java, lineNumber: 179, methodName: proceed, nativeMethod: false}
      ,
      
      {className: org.springframework.transaction.interceptor.TransactionInterceptor$1, fileName: TransactionInterceptor.java, lineNumber: 99, methodName: proceedWithInvocation, nativeMethod: false}
      ,
      
      {className: org.springframework.transaction.interceptor.TransactionAspectSupport, fileName: TransactionAspectSupport.java, lineNumber: 282, methodName: invokeWithinTransaction, nativeMethod: false}
      ,
      
      {className: org.springframework.transaction.interceptor.TransactionInterceptor, fileName: TransactionInterceptor.java, lineNumber: 96, methodName: invoke, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.framework.ReflectiveMethodInvocation, fileName: ReflectiveMethodInvocation.java, lineNumber: 179, methodName: proceed, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor, fileName: ThrowsAdviceInterceptor.java, lineNumber: 125, methodName: invoke, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.framework.ReflectiveMethodInvocation, fileName: ReflectiveMethodInvocation.java, lineNumber: 168, methodName: proceed, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.interceptor.ExposeInvocationInterceptor, fileName: ExposeInvocationInterceptor.java, lineNumber: 92, methodName: invoke, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.framework.ReflectiveMethodInvocation, fileName: ReflectiveMethodInvocation.java, lineNumber: 179, methodName: proceed, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.framework.JdkDynamicAopProxy, fileName: JdkDynamicAopProxy.java, lineNumber: 213, methodName: invoke, nativeMethod: false}
      ,
      
      {className: com.sun.proxy.$Proxy291, fileName: null, lineNumber: -1, methodName: create, nativeMethod: false}
      ,
      
      {className: sun.reflect.NativeMethodAccessorImpl, fileName: NativeMethodAccessorImpl.java, lineNumber: -2, methodName: invoke0, nativeMethod: true}
      ,
      
      {className: sun.reflect.NativeMethodAccessorImpl, fileName: NativeMethodAccessorImpl.java, lineNumber: 62, methodName: invoke, nativeMethod: false}
      ,
      
      {className: sun.reflect.DelegatingMethodAccessorImpl, fileName: DelegatingMethodAccessorImpl.java, lineNumber: 43, methodName: invoke, nativeMethod: false}
      ,
      
      {className: java.lang.reflect.Method, fileName: Method.java, lineNumber: 498, methodName: invoke, nativeMethod: false}
      ,
      
      {className: com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler, fileName: ContextClassLoaderSettingInvocationHandler.java, lineNumber: 26, methodName: invoke, nativeMethod: false}
      ,
      
      {className: com.sun.proxy.$Proxy471, fileName: null, lineNumber: -1, methodName: create, nativeMethod: false}
      ,
      
      {className: sun.reflect.NativeMethodAccessorImpl, fileName: NativeMethodAccessorImpl.java, lineNumber: -2, methodName: invoke0, nativeMethod: true}
      ,
      
      {className: sun.reflect.NativeMethodAccessorImpl, fileName: NativeMethodAccessorImpl.java, lineNumber: 62, methodName: invoke, nativeMethod: false}
      ,
      
      {className: sun.reflect.DelegatingMethodAccessorImpl, fileName: DelegatingMethodAccessorImpl.java, lineNumber: 43, methodName: invoke, nativeMethod: false}
      ,
      
      {className: java.lang.reflect.Method, fileName: Method.java, lineNumber: 498, methodName: invoke, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.support.AopUtils, fileName: AopUtils.java, lineNumber: 333, methodName: invokeJoinpointUsingReflection, nativeMethod: false}
      ,
      
      {className: org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker, fileName: ServiceInvoker.java, lineNumber: 56, methodName: doInvoke, nativeMethod: false}
      ,
      
      {className: org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker, fileName: ServiceInvoker.java, lineNumber: 60, methodName: invoke, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.framework.ReflectiveMethodInvocation, fileName: ReflectiveMethodInvocation.java, lineNumber: 179, methodName: proceed, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.support.DelegatingIntroductionInterceptor, fileName: DelegatingIntroductionInterceptor.java, lineNumber: 133, methodName: doProceed, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.support.DelegatingIntroductionInterceptor, fileName: DelegatingIntroductionInterceptor.java, lineNumber: 121, methodName: invoke, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.framework.ReflectiveMethodInvocation, fileName: ReflectiveMethodInvocation.java, lineNumber: 179, methodName: proceed, nativeMethod: false}
      ,
      
      {className: org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor, fileName: ServiceTCCLInterceptor.java, lineNumber: 70, methodName: invokeUnprivileged, nativeMethod: false}
      ,
      
      {className: org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor, fileName: ServiceTCCLInterceptor.java, lineNumber: 53, methodName: invoke, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.framework.ReflectiveMethodInvocation, fileName: ReflectiveMethodInvocation.java, lineNumber: 179, methodName: proceed, nativeMethod: false}
      ,
      
      {className: org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice, fileName: LocalBundleContextAdvice.java, lineNumber: 57, methodName: invoke, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.framework.ReflectiveMethodInvocation, fileName: ReflectiveMethodInvocation.java, lineNumber: 179, methodName: proceed, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.support.DelegatingIntroductionInterceptor, fileName: DelegatingIntroductionInterceptor.java, lineNumber: 133, methodName: doProceed, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.support.DelegatingIntroductionInterceptor, fileName: DelegatingIntroductionInterceptor.java, lineNumber: 121, methodName: invoke, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.framework.ReflectiveMethodInvocation, fileName: ReflectiveMethodInvocation.java, lineNumber: 179, methodName: proceed, nativeMethod: false}
      ,
      
      {className: org.springframework.aop.framework.JdkDynamicAopProxy, fileName: JdkDynamicAopProxy.java, lineNumber: 213, methodName: invoke, nativeMethod: false}
      ,
      
      {className: com.sun.proxy.$Proxy1448, fileName: null, lineNumber: -1, methodName: create, nativeMethod: false}
      ,
      
      {className: com.atlassian.bitbucket.internal.branch.automerge.AutoMergePullRequestListener, fileName: AutoMergePullRequestListener.java, lineNumber: 191, methodName: createPullRequest, nativeMethod: false}
      ,
      
      {className: com.atlassian.bitbucket.internal.branch.automerge.AutoMergePullRequestListener, fileName: AutoMergePullRequestListener.java, lineNumber: 179, methodName: getOrCreatePullRequest, nativeMethod: false}
      ,
      
      {className: com.atlassian.bitbucket.internal.branch.automerge.AutoMergePullRequestListener, fileName: AutoMergePullRequestListener.java, lineNumber: 126, methodName: processResults, nativeMethod: false}
      ,
      
      {className: com.atlassian.bitbucket.internal.branch.automerge.AutoMergePullRequestListener, fileName: AutoMergePullRequestListener.java, lineNumber: 103, methodName: lambda$null$0, nativeMethod: false}
      ,
      
      {className: com.atlassian.stash.internal.concurrent.ClusterMappedLock, fileName: ClusterMappedLock.java, lineNumber: 49, methodName: withLock, nativeMethod: false}
      ,
      
      {className: com.atlassian.stash.internal.concurrent.ClusterRepositoryLock, fileName: ClusterRepositoryLock.java, lineNumber: 29, methodName: withLock, nativeMethod: false}
      ,
      
      {className: com.atlassian.bitbucket.internal.branch.automerge.AutoMergePullRequestListener, fileName: AutoMergePullRequestListener.java, lineNumber: 102, methodName: lambda$null$1, nativeMethod: false}
      ,
      
      {className: com.atlassian.stash.internal.concurrent.DefaultTransferableStateManager$StateTransferringRunnable, fileName: DefaultTransferableStateManager.java, lineNumber: 166, methodName: run, nativeMethod: false}
      ,
      
      {className: java.util.concurrent.Executors$RunnableAdapter, fileName: Executors.java, lineNumber: 511, methodName: call, nativeMethod: false}
      ,
      
      {className: java.util.concurrent.FutureTask, fileName: FutureTask.java, lineNumber: 266, methodName: run, nativeMethod: false}
      ,
      
      {className: java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask, fileName: ScheduledThreadPoolExecutor.java, lineNumber: 180, methodName: access$201, nativeMethod: false}
      ,
      
      {className: java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask, fileName: ScheduledThreadPoolExecutor.java, lineNumber: 293, methodName: run, nativeMethod: false}
      ,
      
      {className: java.util.concurrent.ThreadPoolExecutor, fileName: ThreadPoolExecutor.java, lineNumber: 1149, methodName: runWorker, nativeMethod: false}
      ,
      
      {className: java.util.concurrent.ThreadPoolExecutor$Worker, fileName: ThreadPoolExecutor.java, lineNumber: 624, methodName: run, nativeMethod: false}
      ,
      
      {className: java.lang.Thread, fileName: Thread.java, lineNumber: 748, methodName: run, nativeMethod: false}
      ], suppressed: []}
      

      I've tested it multiple times always with the same result.
      Cheers
      Tomek

      Attachments

        Issue Links

          Activity

            People

              khughes@atlassian.com Kristy
              ttokarczuk@atlassian.com Tomasz Tokarczuk (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Backbone Issue Sync