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

When hosting on Windows, merges performed can leak temporary files

    XMLWordPrintable

Details

    Description

      Issue Summary

      When Bitbucket Server/Data Center performs merges, it does so using temporary work trees created in %BITBUCKET_HOME%\tmp\git. After the merge completes (successfully or not), the system deletes the work tree. However, when Bitbucket Server/Data Center is running on Windows, Git for Windows creates certain files as read-only and the system does not clear that flag. As a result, cleanup silently fails and temporary files can accumulate over time. For workflows that produce a lot of cross-repository merges (merges where the source and target branches are in different repositories), it's much more likely that temporary files will be leaked.

      This issue does not affect Linux hosts. It is specific to Windows.

      Steps to Reproduce

      1. Create a pull request between two branches in different repositories
      2. Merge the pull request

      Expected Results

      Work tree files in %BITBUCKET_HOME%\tmp\git are cleaned up when the merge completes.

      Actual Results

      Some number of files are left in place, leading to a steady accumulation of files/directories over time.

      Workaround

      When restarting or upgrading Bitbucket Server/Data Center, manually delete the entire %BITBUCKET_HOME%\tmp directory. It will automatically be recreated the next time the system starts. This will purge the accumulated files.

      Attachments

        Issue Links

          Activity

            People

              bturner Bryan Turner (Inactive)
              bturner Bryan Turner (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Backbone Issue Sync