pingora icon indicating copy to clipboard operation
pingora copied to clipboard

Run forever supports not exit progam

Open vicanso opened this issue 1 year ago • 3 comments

What is the problem your feature solves, or the need it fulfills?

I use pingora as a lib for my reverse proxy , but run_forever function will call std::process::exit(0);. I expect close the http server only, but not exit the program,.

Describe the solution you'd like

Support parameter to set not exit the program for run_forever function.

vicanso avatar Mar 24 '24 13:03 vicanso

I want to use pingora as a reverse proxy module, I don't want to restart the program by way to load the new configuration. So I just need to close server1 and run server2, which as follows:

  1. Server1 is running
  2. Server2 trying to receive socks
  3. Server1sending socks and close all runtimes
  4. Server2 run all services

Is it feasible?

vicanso avatar Mar 30 '24 08:03 vicanso

That should be possible. That is how internally we do the graceful restart. But the code is coupled with signal handling for now. Maybe someone can refactor that code to decouple them.

eaufavor avatar Mar 30 '24 18:03 eaufavor