This is a creation in Article, where the information may have evolved or changed.
Background:
Listen , listen, listen, listen, what's the heat escalation? Know nginx students know that Nginx is to support the hot upgrade, you can use the old process to service the link of the previous link, using the new process to service the new link, that is, without stopping the service to complete the system upgrade and run parameter modification.
Environment:
Reason:
ListenListen and listen and listen alongBeego Official Documentswhen graceful is turned on, the old connection does not continue to process when running the Kill-hup PID restart process, but it shuts down directly with the old process, causing the request to return 504. Hear
Solve:
Listen, listen. Listen and listen to in process. Kill () The new process of the parent process to kill directly, send a sigkill signal, the process will not be processed, directly killed, in fact, in the Handlesignals function does not deal with this signal. So the code changes to the following:
file: Grace /server.go, Function Listenandserve (), and Listenandservetls ()
listen to//err = process. Kill ()
Listen and listen to err = process. Signal (OS. Interrupt)
At last:
Listen, listen, listen, hear and listen. The tests have been tested to finish the unfinished connection.
To demand-driven technology, the technology itself does not have a better point, only the division of business.
This article is from the "Sea" blog, be sure to keep this source http://lisea.blog.51cto.com/5491873/1895219