'Stop the server'

def stop_server_process(self):

    if (self.pid == 0):
        return
    try:
        logging.info(('Stopping    SimpleThriftServer    (pid    %s)' % (self.pid,)))
        os.kill(self.pid, 15)
    except Exception as ex:
        logging.exception('(Potentially    ok)    Exception    while    stopping    server')
    os.waitpid(self.pid, 0)
    self.pid = 0
