Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-17975

[C++] Create after-fork facility

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 11.0.0
    • C++

    Description

      Currently, to ensure fork safety when dealing with system resources, we add hand-baked getpid() tests in relevant APIs.

      We could instead have a centralized after-fork facility such as:

      AfterForkToken RegisterAtFork(std::function<void()> after_fork);
      

      The returned token would have to be kept alive for as long as the after-fork callbacks are to be registered.

      (a more elaborate overload with before-fork, after-fork-in-parent, after-fork-in-child callbacks could also be added if necessary)

      Attachments

        Issue Links

          Activity

            People

              apitrou Antoine Pitrou
              apitrou Antoine Pitrou
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m