Documentation for eth_defi.utils.shutdown_hard function.

shutdown_hard(process, log_level=None, block=True, block_timeout=30, check_port=None)[source]

Kill Psutil process.

  • Straight out OS SIGKILL a process

  • Log output if necessary

  • Use port listening to check that the process goes down and frees its ports

  • process (psutil.Popen) – Process to kill

  • block

    Block the execution until the process has terminated.

    You must give check_port option to ensure we enforce the shutdown.

  • block_timeout – How long we give for process to clean up after itself

  • log_level (Optional[int]) – If set, dump anything in Anvil stdout to the Python logging using level INFO.

  • check_port (Optional[int]) – Check that TCP/IP localhost port is freed after shutdown


stdout, stderr as string

Return type

Tuple[bytes, bytes]