Giter VIP home page Giter VIP logo

Comments (4)

andyqzb avatar andyqzb commented on July 29, 2024

百度内部使用没有开启pid,因而没有发现你说的问题。
bdrp修改的点没有涉及到pid的处理
简单解释下两个问题原因

  1. kill命令发送的sigterm信号,nutcracker并未捕获,因而,kill后程序直接退出,不会做退出前的处理(删除pid)
  2. 重复启动的时候,nutcracker会因为侦听端口被占用,启动失败,这时候会进入退出处理逻辑,这个逻辑就包含删除pid一步。
    查看代码后,发现程序正常运行后,只有当epoll_wait返回错误,才会进入程序退出处理逻辑,这点确实不够友好,我向原作者反馈下。

在 2014年5月20日 上午10:21,RocFang [email protected]写道:

你好!

在使用贵项目中集成的nutcracker时,发现如下问题:

1.nutcracker有一个--pid-file选项,所以执行如下命令时

/usr/bin/nutcracker -c /etc/redis/nutcracker.yml --pid-file=/var/run/nutcracker.pid -d

会正常的生成/var/run/nutcracker.pid,且经验证该文件的内容确实是正确的pid。

但是,当用该pid执行kill命令(不是kill -9),当该进程被kill掉后,该pid-file仍然存在,且内容不变。

2.同上,执行如下命令时:

/usr/bin/nutcracker -c /etc/redis/nutcracker.yml --pid-file=/var/run/nutcracker.pid -d

会正常的生成/var/run/nutcracker.pid,且经验证该文件的内容确实是正确的pid。

但,如果继续再次执行该命令,即重复执行,一方面不会有任何错误信息,另一方面返回码$?是正常的0.用ps -ef|grep
nutcracker验证,系统中仍然只有一个Nutcracker在运行,且Pid还是最初的Pid.

但是,/var/run/nutcracker.pid这个文件却被删掉了.

求解惑,这是不是nutcracker的bug啊,不知道bdrp有没有在原始的nutcracker上修改什么..


Reply to this email directly or view it on GitHubhttps://github.com//issues/4
.

from bdrp.

chengyishi avatar chengyishi commented on July 29, 2024

是啊,bdrp没有修改这一点,我们也不开pid文件的

在 2014年5月20日 下午5:04,andy [email protected]写道:

百度内部使用没有开启pid,因而没有发现你说的问题。
bdrp修改的点没有涉及到pid的处理
简单解释下两个问题原因

  1. kill命令发送的sigterm信号,nutcracker并未捕获,因而,kill后程序直接退出,不会做退出前的处理(删除pid)
  2. 重复启动的时候,nutcracker会因为侦听端口被占用,启动失败,这时候会进入退出处理逻辑,这个逻辑就包含删除pid一步。
    查看代码后,发现程序正常运行后,只有当epoll_wait返回错误,才会进入程序退出处理逻辑,这点确实不够友好,我向原作者反馈下。

在 2014年5月20日 上午10:21,RocFang [email protected]写道:

你好!

在使用贵项目中集成的nutcracker时,发现如下问题:

1.nutcracker有一个--pid-file选项,所以执行如下命令时

/usr/bin/nutcracker -c /etc/redis/nutcracker.yml
--pid-file=/var/run/nutcracker.pid -d

会正常的生成/var/run/nutcracker.pid,且经验证该文件的内容确实是正确的pid。

但是,当用该pid执行kill命令(不是kill -9),当该进程被kill掉后,该pid-file仍然存在,且内容不变。

2.同上,执行如下命令时:

/usr/bin/nutcracker -c /etc/redis/nutcracker.yml
--pid-file=/var/run/nutcracker.pid -d

会正常的生成/var/run/nutcracker.pid,且经验证该文件的内容确实是正确的pid。

但,如果继续再次执行该命令,即重复执行,一方面不会有任何错误信息,另一方面返回码$?是正常的0.用ps -ef|grep
nutcracker验证,系统中仍然只有一个Nutcracker在运行,且Pid还是最初的Pid.

但是,/var/run/nutcracker.pid这个文件却被删掉了.

求解惑,这是不是nutcracker的bug啊,不知道bdrp有没有在原始的nutcracker上修改什么..


Reply to this email directly or view it on GitHub<
https://github.com/ops-baidu/bdrp/issues/4>
.


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-43602177
.

from bdrp.

chengyishi avatar chengyishi commented on July 29, 2024

是啊,bdrp没有修改这一点,我们也不开pid文件

我们修改的内容可以看看技术博客http://www.baidu-ops.com/2014/01/20/bdrp/

在 2014年5月20日 上午10:21,RocFang [email protected]写道:

你好!

在使用贵项目中集成的nutcracker时,发现如下问题:

1.nutcracker有一个--pid-file选项,所以执行如下命令时

/usr/bin/nutcracker -c /etc/redis/nutcracker.yml --pid-file=/var/run/nutcracker.pid -d

会正常的生成/var/run/nutcracker.pid,且经验证该文件的内容确实是正确的pid。

但是,当用该pid执行kill命令(不是kill -9),当该进程被kill掉后,该pid-file仍然存在,且内容不变。

2.同上,执行如下命令时:

/usr/bin/nutcracker -c /etc/redis/nutcracker.yml --pid-file=/var/run/nutcracker.pid -d

会正常的生成/var/run/nutcracker.pid,且经验证该文件的内容确实是正确的pid。

但,如果继续再次执行该命令,即重复执行,一方面不会有任何错误信息,另一方面返回码$?是正常的0.用ps -ef|grep
nutcracker验证,系统中仍然只有一个Nutcracker在运行,且Pid还是最初的Pid.

但是,/var/run/nutcracker.pid这个文件却被删掉了.

求解惑,这是不是nutcracker的bug啊,不知道bdrp有没有在原始的nutcracker上修改什么..


Reply to this email directly or view it on GitHubhttps://github.com//issues/4
.

from bdrp.

RocFang avatar RocFang commented on July 29, 2024

明白了~谢谢两位!

from bdrp.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.