mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 02:41:25 +00:00
Merge pull request #110081 from wojtek-t/document_shutdown_sequence
Diagram for graceful shutdown
This commit is contained in:
commit
c79b909de7
@ -421,6 +421,33 @@ func (s *GenericAPIServer) PrepareRun() preparedGenericAPIServer {
|
||||
|
||||
// Run spawns the secure http server. It only returns if stopCh is closed
|
||||
// or the secure port cannot be listened on initially.
|
||||
// This is the diagram of what channels/signals are dependent on each other:
|
||||
//
|
||||
// stopCh
|
||||
// |
|
||||
// ---------------------------------------------------------
|
||||
// | |
|
||||
// ShutdownInitiated (shutdownInitiatedCh) |
|
||||
// | |
|
||||
// (ShutdownDelayDuration) (PreShutdownHooks)
|
||||
// | |
|
||||
// AfterShutdownDelayDuration (delayedStopCh) preShutdownHooksHasStoppedCh
|
||||
// | |
|
||||
// |---------------------------------- |
|
||||
// | | |
|
||||
// | (HandlerChainWaitGroup::Wait) |
|
||||
// | | |
|
||||
// | InFlightRequestsDrained (drainedCh) |
|
||||
// | | |
|
||||
// [without ShutdownSendRetryAfter] [with ShutdownSendRetryAfter] |
|
||||
// | | |
|
||||
// ---------------------------------------------------------
|
||||
// |
|
||||
// stopHttpServerCh
|
||||
// |
|
||||
// listenerStoppedCh
|
||||
// |
|
||||
// HTTPServerStoppedListening (httpServerStoppedListeningCh)
|
||||
func (s preparedGenericAPIServer) Run(stopCh <-chan struct{}) error {
|
||||
delayedStopCh := s.lifecycleSignals.AfterShutdownDelayDuration
|
||||
shutdownInitiatedCh := s.lifecycleSignals.ShutdownInitiated
|
||||
|
Loading…
Reference in New Issue
Block a user