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

GitSshInputHandler should expect to be interrupted during close()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Low
    • None
    • None
    • SSH
    • None

    Description

      Similar to STASH-3820, the process() method could be interrupted by a .cancel() on the Git ExternalProcess.

      We call Closeables.closeQuietly(out); in a finally block, which closes the outputStream (the stdin of the Git process). But if the Git process has been cancelled, this causes a "Bad file descriptor" warning. NOTE: I have not attempted to reproduce this, so this is a hunch - it's possible that the cause of this error is different to STASH-3820.

      2013-08-28 02:02:54,458 DEBUG [NioProcessor-5]  c.a.s.i.scm.git.ssh.GitSshScmRequest upload-pack canceled
      2013-08-28 02:02:54,468 WARN  [ExtProcess - IO Pump:thread-14696] Kontagent QA 122x337792x7 30c6f0 10.36.103.130 SSH - git-upload-pack '/ETL/etl-stream.git' com.google.common.io.Closeables IOException thrown while closing Closeable.
      java.io.IOException: Bad file descriptor
      	at java.io.FileOutputStream.close0(Native Method) ~[na:1.6.0_22]
      	at java.io.FileOutputStream.close(FileOutputStream.java:279) ~[na:1.6.0_22]
      	at java.io.FilterOutputStream.close(FilterOutputStream.java:143) ~[na:1.6.0_22]
      	at com.google.common.io.Closeables.close(Closeables.java:79) [guava-10.0.1.jar:na]
      	at com.google.common.io.Closeables.closeQuietly(Closeables.java:98) [guava-10.0.1.jar:na]
      	at com.atlassian.stash.internal.scm.git.ssh.GitSshInputHandler.process(GitSshInputHandler.java:42) [stash-scm-git-2.7.0_1376959322000.jar:na]
      	at com.atlassian.utils.process.PluggableProcessHandler.provideInput(PluggableProcessHandler.java:135) [atlassian-processutils-1.5.10.jar:na]
      	at com.atlassian.utils.process.ExternalProcessImpl$1.doTask(ExternalProcessImpl.java:302) [atlassian-processutils-1.5.10.jar:na]
      	at com.atlassian.utils.process.LatchedRunnable.run(LatchedRunnable.java:36) [atlassian-processutils-1.5.10.jar:na]
      	at com.atlassian.stash.internal.concurrent.StateTransferringExecutor$StateTransferringRunnable.run(StateTransferringExecutor.java:68) [stash-platform-2.7.0.jar:na]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_22]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_22]
      	at java.lang.Thread.run(Thread.java:662) [na:1.6.0_22]
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              aahmed Adam Ahmed (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: