Esempio n. 1
0
    def start(
        self,
        timeout: float = 60,
        takeover_from: Optional[int] = None,
        extra_args: Optional[List[str]] = None,
    ) -> None:
        """
        Run "eden daemon" to start the eden daemon.
        """
        use_gdb = False
        if os.environ.get("EDEN_GDB"):
            use_gdb = True
            # Starting up under GDB takes longer than normal.
            # Allow an extra 90 seconds (for some reason GDB can take a very
            # long time to load symbol information, particularly on dynamically
            # linked builds).
            timeout += 90

        takeover = takeover_from is not None
        self.spawn_nowait(gdb=use_gdb, takeover=takeover, extra_args=extra_args)

        process = self._process
        assert process is not None
        util.wait_for_daemon_healthy(
            proc=process,
            config_dir=self._eden_dir,
            get_client=self.get_thrift_client,
            timeout=timeout,
            exclude_pid=takeover_from,
        )
Esempio n. 2
0
 def wait_for_is_healthy(self, timeout: float = 30) -> bool:
     process = self._process
     assert process is not None
     health = util.wait_for_daemon_healthy(
         proc=process,
         config_dir=self._eden_dir,
         get_client=self.get_thrift_client,
         timeout=timeout,
     )
     return health.is_healthy()