How to solve Gateway: Worker- > name conflict?

problem description

Environment: Workerman version:3.5.14 PHP version:7.2.8
in order to deploy the exercise separately, I started Register Gateway BusinessWorker separately on the same machine , and wokerman.log kept prompting:
2018-09-24 11:15:18 pid:9978 Gateway: Worker- > name conflict. Key:127.0.0.1:MailBusinessWorker:3
2018-09-24 11:15:18 pid:9966 Gateway: Worker- > name conflict. Key:127.0.0.1:MailBusinessWorker:3
2018-09-24 11:15:18 pid:9926 Gateway: Worker- > name conflict. Key:127.0.0.1:MailBusinessWorker:3
2018-09-24 11:15:18 pid:9966 Gateway: Worker- > name conflict. Key:127.0.0.1:MailBusinessWorker:3
2018-09-24 11:15:18 pid:9954 Gateway: Worker- > name conflict. Key:127.0.0.1:MailBusinessWorker:3
2018-09-24 11:15:18 pid:9978 Gateway: Worker- > name conflict. Key:127.0.0.1:MailBusinessWorker:3
caused my disk to fill up very quickly.

the environmental background of the problems and what methods you have tried

I looked at the source code and said that businessWorker- > name could not be the same on a server, but I still didn"t figure out how to prompt conflict

.

related codes

/ / bussinessWorker process
$worker = new BusinessWorker ();
$worker- > name = "MailBusinessWorker";
$worker- > count = 6;
.

Please help me. What is the cause of conflict?? How to solve it?

Jul.13,2021

there should be a server that started MailBusinessWorker twice, resulting in


problem solved,
reason:
use php to manage processes: shell_exec ("php MailBusinessWorker.php stop"),
but delete the main process pid, but the child process is not deleted at the same time, resulting in a conflict prompt the second time you start BusinessWorker, (Gateway: Worker- > name conflict), similarly GatewayWorker all processes are not deleted clean, there will also be a conflict prompt.
solution:
first step: shell_exec ("php MailBusinessWorker.php stop");
second step, write a Php function and call the ps and kill commands to force the deletion of all undeleted child processes

in short: if you delete all related worker processes, there will be no error.

Menu