boolListenerImpl::drainClose()const{// When a listener is draining, the "drain close" decision is the union of the per-listener drain// manager and the server wide drain manager. This allows individual listeners to be drained and// removed independently of a server-wide drain event (e.g., /healthcheck/fail or hot restart).returnlocal_drain_manager_->drainClose()||parent_.server_.drainManager().drainClose();}
// See if we want to drain/close the connection. Send the go away frame prior to encoding the// header block.if(connection_manager_.drain_state_==DrainState::NotDraining&&connection_manager_.drain_close_.drainClose()){// This doesn't really do anything for HTTP/1.1 other then give the connection another boost// of time to race with incoming requests. It mainly just keeps the logic the same between// HTTP/1.1 and HTTP/2.connection_manager_.startDrainSequence();connection_manager_.stats_.named_.downstream_cx_drain_close_.inc();ENVOY_STREAM_LOG(debug,"drain closing connection",*this);}