code: def prefork(self, options, options_bootstrapper):
      
      # If any nodes exist in the product graph, wait for the initial watchman event to avoid
      # racing watchman startup vs invalidation events.
      graph_len = self._scheduler.graph_len()
      if graph_len > 0:
        self._logger.debug('graph len was {}, waiting for initial watchman event'.format(graph_len))
        self._watchman_is_running.wait()
      v2_ui = options.for_global_scope().v2_ui
      zipkin_trace_v2 = options.for_scope('reporting').zipkin_trace_v2
      session = self._graph_helper.new_session(zipkin_trace_v2, v2_ui)
  
      if options.for_global_scope().loop:
        prefork_fn = self._prefork_loop
      else:
        prefork_fn = self._prefork_body
  
      target_roots, exit_code = prefork_fn(session, options, options_bootstrapper)
      return session, target_roots, exit_code
docs: Runs all pre-fork logic in the process context of the daemon.
  
      :returns: `(LegacyGraphSession, TargetRoots, exit_code)`