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

Bitbucket Server commands timeout when trying process extremely long commit messages

    XMLWordPrintable

Details

    Description

      Issue Summary

      Bitbucket Server is unable to process git output containing extremely long commit messages in a reasonable amount of time. This causes actions which use this output to timeout and fail (e.g. loading the commits page in the UI).

      Steps to Reproduce

      1. Push a commit (or commits) with extremely long commit messages (millions of characters, hundreds of thousands of lines) to a repository in Bitbucket Server.
      2. Attempt to perform an action that causes Bitbucket Server to run a git rev-list command over those commits (e.g. viewing the commits page in the UI for that repository).

      Expected Results

      The git rev-list command completes quickly (~seconds, or less), and the associated action (e.g. viewing the commits page in the UI) completes successfully without any problems.

      Actual Results

      The git rev-list command takes an excessive amount of time to complete (multiple minutes). This will lead to for example REST requests timings out (so the UI for the commits page will show a 500 error after waiting for the commits).

      The below exception is thrown in the bitbucket.log file:

      c.a.b.i.p.nu.NioNuProcessHandler [/opt/git/bin/git rev-list --format=%H%x02%P%x02%aN%x02%aE%x02%at%x02%cN%x02%cE%x02%ct%n%B%n%x03END%x04 --no-min-parents --stdin --]: Dropping callback invocation (Canceled: false; Timed out: true)
      c.a.b.i.p.nu.NioNuProcessHandler [/opt/git/bin/git rev-list --format=%H%x02%P%x02%aN%x02%aE%x02%at%x02%cN%x02%cE%x02%ct%n%B%n%x03END%x04 --no-min-parents --stdin --]: Dropping callback invocation (Canceled: false; Timed out: true)
      c.a.b.i.p.nu.NioNuProcessHandler [/opt/git/bin/git rev-list --format=%H%x02%P%x02%aN%x02%aE%x02%at%x02%cN%x02%cE%x02%ct%n%B%n%x03END%x04 --no-min-parents --stdin --]: Dropping callback invocation (Canceled: false; Timed out: true)
      c.a.s.i.w.HandlerExceptionResolverImpl An error occurred while executing an external process: process timed out
      com.atlassian.bitbucket.ServerException: An error occurred while executing an external process: process timed out
      	at com.atlassian.bitbucket.scm.git.command.GitCommandExitHandler.evaluateThrowable(GitCommandExitHandler.java:120)
      	at com.atlassian.bitbucket.scm.git.command.GitCommandExitHandler.onError(GitCommandExitHandler.java:208)
      	at com.atlassian.stash.internal.scm.git.command.revlist.RevCoreExitHandler.onError(RevCoreExitHandler.java:55)
      	at com.atlassian.bitbucket.scm.DefaultCommandExitHandler.onExit(DefaultCommandExitHandler.java:32)
      	at com.atlassian.bitbucket.internal.process.nu.NioNuProcessHandler.callExitHandler(NioNuProcessHandler.java:285)
      	at com.atlassian.bitbucket.internal.process.nu.NioNuProcessHandler.finish(NioNuProcessHandler.java:326)
      	at com.atlassian.bitbucket.internal.process.nu.NioNuProcessHandler.onExit(NioNuProcessHandler.java:123)
      	at com.zaxxer.nuprocess.internal.BasePosixProcess.onExit(BasePosixProcess.java:319)
      	at com.zaxxer.nuprocess.linux.ProcessEpoll.handleExit(ProcessEpoll.java:375)
      	at com.zaxxer.nuprocess.linux.ProcessEpoll.cleanupProcess(ProcessEpoll.java:334)
      	at com.zaxxer.nuprocess.linux.ProcessEpoll.process(ProcessEpoll.java:272)
      	at com.zaxxer.nuprocess.internal.BaseEventProcessor.run(BaseEventProcessor.java:81)
      	at com.zaxxer.nuprocess.linux.ProcessEpoll.run(ProcessEpoll.java:188)
      	at com.zaxxer.nuprocess.linux.LinuxProcess.run(LinuxProcess.java:114)
      	at com.zaxxer.nuprocess.linux.LinProcessFactory.runProcess(LinProcessFactory.java:50)
      	at com.zaxxer.nuprocess.NuProcessBuilder.run(NuProcessBuilder.java:273)
      	at com.atlassian.bitbucket.internal.process.nu.NuNioProcessHelper.run(NuNioProcessHelper.java:75)
      	at com.atlassian.bitbucket.internal.process.NioCommand.call(NioCommand.java:52)
      	at com.atlassian.stash.internal.commit.DefaultCommitService.getCommits(DefaultCommitService.java:450)
      	at com.atlassian.stash.internal.commit.DefaultCommitService.getCommits(DefaultCommitService.java:175)
      	at com.atlassian.stash.internal.web.repos.RepositoryController.getCommits(RepositoryController.java:218)
      	at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
      	at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
      	at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
      	at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
      	at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
              ...
      Caused by: com.atlassian.utils.process.ProcessTimeoutException: process timed out
      	at com.atlassian.bitbucket.internal.process.nu.NioNuProcessHandler.callExitHandler(NioNuProcessHandler.java:269)
      	... 52 common frames omitted
      

      Workaround

      Currently there is no known workaround for this behaviour.

      Attachments

        Issue Links

          Activity

            People

              spetrucev Stefan
              spetrucev Stefan
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Backbone Issue Sync