Fix graceful doc (#20883)

This commit is contained in:
wxiaoguang 2022-08-21 14:50:27 +08:00 committed by GitHub
parent 11bae50484
commit 6784a707d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,11 +24,12 @@ const (
stateTerminate stateTerminate
) )
// There are three places that could inherit sockets: // There are some places that could inherit sockets:
// //
// * HTTP or HTTPS main listener // * HTTP or HTTPS main listener
// * HTTP or HTTPS install listener
// * HTTP redirection fallback // * HTTP redirection fallback
// * SSH // * Builtin SSH listener
// //
// If you add an additional place you must increment this number // If you add an additional place you must increment this number
// and add a function to call manager.InformCleanup if it's not going to be used // and add a function to call manager.InformCleanup if it's not going to be used
@ -305,8 +306,9 @@ func (g *Manager) setState(st state) {
g.state = st g.state = st
} }
// InformCleanup tells the cleanup wait group that we have either taken a listener // InformCleanup tells the cleanup wait group that we have either taken a listener or will not be taking a listener.
// or will not be taking a listener // At the moment the total number of servers (numberOfServersToCreate) are pre-defined as a const before global init,
// so this function MUST be called if a server is not used.
func (g *Manager) InformCleanup() { func (g *Manager) InformCleanup() {
g.createServerWaitGroup.Done() g.createServerWaitGroup.Done()
} }