Upgrade
lastmod 2022-01-11created 2022-01-113 edits
Upgrading an executable while it is running
The upgrade method used by Nginx
- Replace the original executable file with the new one
- Send the USR2 signal to the master process
- The master process renames its process ID file with the .oldbin extension
- Starts the new executable, which creates new worker processes
- All worker processes start accepting requests
- When the WINCH signal is sent to the first master process, it asks its worker processes to shut down gracefully
- The old master process does not close its listen sockets and can create worker processes again if needed
- If the new master process does not work properly
- Send the HUP signal to the old master process so it starts new worker processes, and after the new master's workers have exited, send QUIT to the new master to shut it down
- Send the TERM signal to the new master process to ask its current worker processes to stop immediately. When the new master dies, the old master starts new worker processes
- When the new master process exits this way, the old master process removes the .oldbin extension
- If the upgrade succeeds, send the QUIT signal to the old master process to shut it down, leaving only the new processes
Other upgrade methods
- Hot restart — envoy 1.21.0-dev-0f4acd documentation - Envoy's Hot Restart method
- Truly Seamless Reloads with HAProxy – No More Hacks! - HAProxy Seamless Reload