Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: make stop can't kill multi apisix server #1671

Closed
nerowangtc opened this issue Jun 9, 2020 · 9 comments
Closed

bug: make stop can't kill multi apisix server #1671

nerowangtc opened this issue Jun 9, 2020 · 9 comments
Labels

Comments

@nerowangtc
Copy link

Issue description

If I use make run to start multiple apisix server, the process shows below:
[nero@VM_42_81_centos ~/incubator-apisix]$ ps -ef | grep apisix
nero 28293 1 0 10:35 ? 00:00:00 nginx: master process /usr/local/openresty/bin/openresty -p /home/nero/incubator-apisix/ -c /home/nero/incubator-apisix/conf/nginx.conf
nero 29053 1 0 10:40 ? 00:00:00 nginx: master process /usr/local/openresty/bin/openresty -p /home/nero/incubator-apisix/ -c /home/nero/incubator-apisix/conf/nginx.conf

Now if i use make stop to stop a apisxi server , it goes ok
[nero@VM_42_81_centos ~/incubator-apisix]$ make stop
/usr/local/openresty/bin/openresty -p $PWD/ -c $PWD/conf/nginx.conf -s stop
[nero@VM_42_81_centos ~/incubator-apisix]$ ps -ef | grep apisix
nero 28293 1 0 10:35 ? 00:00:00 nginx: master process /usr/local/openresty/bin/openresty -p /home/nero/incubator-apisix/ -c /home/nero/incubator-apisix/conf/nginx.conf
nero 29362 28108 0 10:42 pts/0 00:00:00 grep --color=auto apisix

But if is make stop again, it produce a error message
[nero@VM_42_81_centos ~/incubator-apisix]$ make stop
/usr/local/openresty/bin/openresty -p $PWD/ -c $PWD/conf/nginx.conf -s stop
nginx: [error] open() "/home/nero/incubator-apisix/logs/nginx.pid" failed (2: No such file or directory)
make: *** [stop] Error 1
[nero@VM_42_81_centos ~/incubator-apisix]$ ps -ef | grep apisix
nero 28293 1 0 10:35 ? 00:00:00 nginx: master process /usr/local/openresty/bin/openresty -p /home/nero/incubator-apisix/ -c /home/nero/incubator-apisix/conf/nginx.conf
nero 29421 28108 0 10:42 pts/0 00:00:00 grep --color=auto apisix

and the another apisix process remains
I think this is a bug if some one missuse this command

Environment

  • apisix version (cmd: apisix version):
  • OS:

Minimal test code / Steps to reproduce the issue

  1. make run
  2. make run
  3. make stop

What's the actual result? (including assertion message & call stack if applicable)

What's the expected result?

@Miss-you
Copy link
Member

Miss-you commented Jun 9, 2020

Hi, the logic for 'make stop' is based on the 'nginx.pid' file. openresty processes, rather than stopping all openresty processes, so the 'make stop' stops only a group of openresty processes

@Miss-you
Copy link
Member

Miss-you commented Jun 9, 2020

On the other hand, I think the root cause of the problem is that multiple 'make run' or 'apisix start' will start multiple groups of apisix processes

@Miss-you
Copy link
Member

Miss-you commented Jun 9, 2020

I think the point we should be discussing is whether multiple 'apisix starts' should only start a set of apisix processes

@nerowangtc
Copy link
Author

In my point of view, i think in the current stage of apisix, it is meaningless to start multiple apisix server with make run command, cuz only can access one at a time

@moonming
Copy link
Member

moonming commented Jun 9, 2020

@nerowangtc is this issue same as #1663?

@nerowangtc
Copy link
Author

@moonming It'looks like the same

@moonming
Copy link
Member

moonming commented Jun 9, 2020

@nerowangtc got it, it's a bug when enabled reuseport, welcome PR

@membphis
Copy link
Member

only one APISIX instance can be started now.

image

@membphis
Copy link
Member

membphis commented Aug 7, 2020

fixed

@membphis membphis closed this as completed Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants