Details
-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
8.0.2, 8.1.2, 8.2.1, 8.3.0
-
Severity 3 - Minor
-
0
-
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
- Run a git command using com.atlassian.bitbucket.scm.git.command.GitCommand, and specify a custom CommandOutputHandler class
- Call com.atlassian.utils.process.Watchdog.cancel() in the execution of CommandOutputHandler.process
- 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