Commit 5212b4fe authored by André Anjos's avatar André Anjos 💬

[agent] Be a bit more careful before killing a process

parent aaca14e7
Pipeline #1934 passed with stage
......@@ -32,6 +32,7 @@ import shutil
import logging
logger = logging.getLogger(__name__)
import psutil
import gevent
import zmq.green as zmq
......@@ -484,5 +485,5 @@ class Agent(object):
def kill(self):
"""Stops the user process by force - to be called from signal handlers"""
if self.process is not None:
if self.process is not None and psutil.pid_exists(self.process.pid):
self.process.kill()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment