def ensureNoMoreRender(self):
        """
        Force kill of all process attached to the current EUID. this ensures that all command processes have been killed.
        :return: a boolean indicating success
        """

        try:
            # Ensure we don't have anymore rendering process
            keepPID = [os.getpid(), os.getppid()].extend(self.getToKeepPIDs())
            effectiveUID = os.geteuid()
            LOGGER.debug("PID to keep: %r" % keepPID)

            # Get pids of current user (usually 'render')
            renderProcessList = subprocess.check_output(["ps", "-u", str(effectiveUID), "-o", "pid", "h"]).split()

            # Filter the list to preserve the current process and parent process
            killPID = [pid for pid in renderProcessList if int(pid) not in keepPID]
            # LOGGER.debug("PID to kill: %r" % killPID)

            # Send SIGKILL to everyone else
            for pid in killPID:
                try:
                    os.kill(int(pid), signal.SIGKILL)
                    LOGGER.debug("SIGKILL sent to %s" % pid)
                except OSError:
                    LOGGER.debug("Impossible to send SIGKILL to %s, the process has vanished." % pid)
                    continue
        except Exception as err:
            LOGGER.error("Error when killing render processes. Some processes of a closed command might still run (%s)" % err)
            return False
        return True
dataset/ETHPy150Open mikrosimage/OpenRenderManagement/src/octopus/worker/worker.py/Worker.ensureNoMoreRender/original