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

Command input handler can hang when process is cancelled

XMLWordPrintable

      Issue Summary

      This bug is affecting plugins using Bitbucket’s Java API and it may lead to unexpected thread hangs, as well as performance starvation due to exhaustion of IO pump threads.

      This issue was found in Bitbucket 8.1.0 and 8.1.1.

      Steps to Reproduce

      1. Run a git command using an input/output handler (e.g. running git cat-file --batch with a subclass of com.atlassian.bitbucket.io.AbstractCommandInputOutputHandler)
      2. The input handler runs until it is blocked in OutputStream.write. This happens when git's stdin is full and there is backpressure
      3. The output handler calls Watchdog.cancel() on the provided watchdog
      4. The input handler is now blocked forever in OutputStream.write.

      Expected Results

      On Bitbucket 7, step #3 above causes an IOException on the input handler thread, letting it exit.

      Actual Results

      On Bitbucket 8.1.x the input handler thread is hung even once the underlying process exits. 

      Workaround

      No workaround available

            mheemskerk Michael Heemskerk (Inactive)
            dbonotto Dario B
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: