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

Support toggling between process forking LaunchMechanism

XMLWordPrintable

    • 1
    • 1
    • We collect Bitbucket feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.
    • RtB - Service ops & Tech entropy

      Bitbucket's codepath that forks Git processes leverages Java's Java_java_lang_ProcessImpl_forkAndExec, via NuProcess. This code provides three approaches to forking:

      • FORK,
      • POSIX_SPAWN,
      • VFORK

      Of these, Bitbucket currently uses the VFORK mode. It would be useful to support the ability to optionally select the POSIX_SPAWN for the following reasons:

      Firstly, we've seen at least one (and possibly more) support cases where Bitbucket, specifically the sidecar, intermittently fails to successfully spawn new git processes. The symptom has been that the new process is forked (i.e. a copy of the mesh-app Java process) but execve() is never called. These processes then accumulate until they are killed. The exact root cause is not known at this time, however a custom build of Bitbucket was supplied that uses POSIX_SPAWN and this appears to have solve, or at least worked around, the problem.

      The second reason why it would be useful have the option to use POSIX_SPAWN is because in Java 25 the VFORK mode is deprecated:

      and is planned to be removed in a future release, possibly as early as Java 26:

      The Java deprecations are not an immediate problem, since Bitbucket doesn't support running on anything beyond Java 21 LTS, and won't for a while. But being able to test the POSIX_SPAWN will be useful in deciding if it causes any problem.

              behumphreys Ben Humphreys
              behumphreys Ben Humphreys
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: