예제 #1
0
    def testProcessDiesAfterBeingTracked(self):
        p = BetterPopen(["sleep", "1"])
        zombieReaper.autoReapPID(p.pid)
        # wait for the grim reaper to arrive
        sleep(4)

        # Throws error because pid is not found or is not child
        self.assertRaises(OSError, os.waitpid, p.pid, os.WNOHANG)
예제 #2
0
    def testProcessDiedBeforeBeingTracked(self):
        p = BetterPopen(["sleep", "0"])
        # wait for the process to die
        sleep(1)

        zombieReaper.autoReapPID(p.pid)

        # Throws error because pid is not found or is not child
        self.assertRaises(OSError, os.waitpid, p.pid, os.WNOHANG)
예제 #3
0
    def stop(self):
        try:
            os.kill(self.process.pid, signal.SIGKILL)
        except:
            pass

        try:
            zombieReaper.autoReapPID(self.process.pid)
        except AttributeError:
            if zombieReaper is not None:
                raise
예제 #4
0
    def stop(self):
        try:
            os.kill(self.process.pid, signal.SIGKILL)
        except:
            pass

        self.process.poll()
        # Don't try to read if the process is in D state
        if (self.process.returncode is not None and
                self.process.returncode != 0):
            err = self.process.stderr.read()
            out = self.process.stdout.read()
            self.log.debug("Pool handler existed, OUT: '%s' ERR: '%s'",
                           out, err)

        try:
            zombieReaper.autoReapPID(self.process.pid)
        except AttributeError:
            if zombieReaper is not None:
                raise
예제 #5
0
    def stop(self):
        try:
            os.kill(self.process.pid, signal.SIGKILL)
        except:
            pass

        self.process.poll()
        # Don't try to read if the process is in D state
        if (self.process.returncode is not None
                and self.process.returncode != 0):
            err = self.process.stderr.read()
            out = self.process.stdout.read()
            self.log.debug("Pool handler existed, OUT: '%s' ERR: '%s'", out,
                           err)

        try:
            zombieReaper.autoReapPID(self.process.pid)
        except AttributeError:
            if zombieReaper is not None:
                raise