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

Cancelling git via Watchdog.cancel() produces a ProcessFailedException

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Medium
    • None
    • 8.0.2, 8.1.2, 8.2.1, 8.3.0
    • API - Java, Mesh

    Description

      Issue Summary

      When cancelling git through watchdog.cancel() causes a specific issue of ProcessFailedException of the command exited with code -1. This issue occurs in Bitbucket 8, which this behavior was specifically regressed after https://jira.atlassian.com/browse/BSERV-13350 was marked as addressed, namely in versions 8.0.2, 8.1.2, 8.2.1, and 8.3.0.

      Steps to Reproduce

      1. Run a git command using com.atlassian.bitbucket.scm.git.command.GitCommand, and specify a custom CommandOutputHandler class
      1. Call com.atlassian.utils.process.Watchdog.cancel() in the execution of CommandOutputHandler.process
      1. GitCommand.call() throws the following exception available in the actual results.

      Expected Results

      GitCommand.call() should return successfully, since the command handler intentionally stopped the process. There is no erroneous condition.

      The expected behavior can be observed on all Bitbucket 7 versions and on early Bitbucket 8 versions (e.g. 8.1.1).

      Actual Results

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

      com.atlassian.bitbucket.scm.ProcessFailedException: 'git cat-file --batch' exited with code -1 
      at com.atlassian.stash.internal.scm.git.command.BioStdioHandler.onComplete(BioStdioHandler.java:92)
      at com.atlassian.stash.internal.scm.git.mesh.LatchedNioStdioHandler.onComplete(LatchedNioStdioHandler.java:61)
      at com.atlassian.stash.internal.scm.git.mesh.AbstractFragmentResponseObserver.maybeSummarize(AbstractFragmentResponseObserver.java:278) 

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

      Attachments

        Activity

          People

            Unassigned Unassigned
            d6427b6fb657 Guilherme Bueno
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: