session.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:ave 作者: sonyxperiadev 项目源码 文件源码
def terminate(self):
        try:
            os.kill(self.pid, signal.SIGTERM)
        except OSError, e:
            if e.errno == errno.ESRCH:
                return # process already killed by someone else
            if e.errno == errno.EPERM:
                # this can only happen if the original session was started as
                # a different user. e.g. if the broker has been restarted with
                # --demote=<some other user>. but don't worry too much about it
                # as sessions are eventually terminated anyway.
                print(
                    'WARNING: session with PID=%d not terminated because it '
                    'is owned by a different user. did you restart a broker '
                    'as a different user?' % self.pid
                )
                return
            raise e
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号