walkor / workerman

An asynchronous event driven PHP socket framework. Supports HTTP, Websocket, SSL and other custom protocols.

Home Page:http://www.workerman.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logic of worker's reload have mistake - please check

webrobot1 opened this issue · comments

Roadmap is

  1. master check workers status in monitorWorkersForLinux by pcntl_wait function
  2. Get pid of worker who exit
  3. if master's status is not STATUS_SHUTDOWN it fork byself by forkWorkers (like reload always, without check is worker have "reloadable" property)
  4. new worker who is realoded start event loop (as same)
  5. master return back and execute reload function, execute onMasterReload
  6. reload ALL children workers who have reloadable property (put they pid to reloadable_pid_array) with SIGKILL signal on timeout
  7. "Send reload signal to a worker process which reloadable is false."

Well the problem is - worker who have exit every time forked
After this ALL childrens try to reload - these childrens maybe work good and they dont need reload, and the child who was fork but dont have reloadable property reload too...

commented

I'm sorry, but I really can't understand where your question is.

I'm sorry, but I really can't understand where your question is.

it is normal what workers always reload when one of them exit ? and these worker too doesnt matter is it have reloadable property or not

commented

it is normal what workers always reload when one of them exit ?

We haven't been able to reproduce that. Could you provide an example, please?

it is normal what workers always reload when one of them exit ?

We haven't been able to reproduce that. Could you provide an example, please?

This is video example

2023-07-22-15-21-02.mp4
commented

From your video, I can see that a worker was killed and the main process restarted a new one. This is not a problem. What result are you expecting?

From your video, I can see that a worker was killed and the main process restarted a new one. This is not a problem. What result are you expecting?

what different if worker wil get public property reloadable=true or reloadable=false ? as i understand if reloadable=false it mean it will not reload after master check what it is dead and if no another workers - master finish too

commented

when run command php start.php reload,the workers with reloadable=false not exit.

when run command php start.php reload,the workers with reloadable=false not exit.

this is very consfuse what reloadable relaod worker after his exit - i have a case then worker finish on error and i was belive that flag reloadable=false will not reload him after finish

may be good idea add property restart and if worker is finish do not reload it.

commented

This feature is not useful for the majority of users, and workerman will not support it.

ok , thanks for feedback