def call(self, cmd: List[str]) -> None:
        """Executes one callback at a time.

        Already running command is killed (including child processes).
        If it couldn't be killed we wait until it finishes.

        :param cmd: command to be executed"""
        kwargs: Dict[str, Any] = {'stacklevel': 3} if sys.version_info >= (3, 8) else {}
        logger.debug('CallbackExecutor.call(%s)', cmd, **kwargs)

        if cmd[-3] == CallbackAction.ON_RELOAD:
            return self._on_reload_executor.call_nowait(cmd)

        self._kill_process()
        with self._condition:
            self._cmd = cmd
            self._condition.notify()
Executes one callback at a time.

        Already running command is killed (including child processes).
        If it couldn't be killed we wait until it finishes.

        :param cmd: command to be executed
patroni/postgresql/callback_executor.py