@@ -139,27 +139,18 @@ func (s *Server) Run() {
139139}
140140
141141func  (s  * Server ) Stop (timeout  time.Duration ) {
142- 	shutdownStart  :=  time .Now ()
143- 	s .logger .Info ("Starting server graceful shutdown" ,
144- 		zap .String ("server" , s .name ),
145- 		zap .Duration ("timeout" , timeout ))
146- 
147142	// Shutdown order is critical: 
148143	// 1. HTTP server first (drains REST/gRPC-Gateway requests) 
149144	// 2. gRPC server second (only pure gRPC connections remain) 
150145	// 
151146	// This ensures HTTP requests that call s.rpcServer.ServeHTTP() can complete 
152147	// before we stop the underlying gRPC server. 
153148	if  s .httpServer  !=  nil  {
154- 		s .logger .Info ("Starting HTTP server graceful shutdown" )
155- 
156149		ctx , cancel  :=  context .WithTimeout (context .Background (), timeout )
157150		defer  cancel ()
158151
159152		if  err  :=  s .httpServer .Shutdown (ctx ); err  !=  nil  {
160153			s .logger .Error ("HTTP server failed to shut down gracefully" , zap .Error (err ))
161- 		} else  {
162- 			s .logger .Info ("HTTP server shutdown completed gracefully" )
163154		}
164155	}
165156
@@ -168,13 +159,8 @@ func (s *Server) Stop(timeout time.Duration) {
168159	// - HTTP-served connections were already drained in step 1 
169160	// - Pure gRPC clients have retry logic and Envoy connection draining to handle this 
170161	if  s .rpcServer  !=  nil  {
171- 		s .logger .Info ("Stopping gRPC server" )
172162		s .rpcServer .Stop ()
173163	}
174- 
175- 	s .logger .Info ("Server shutdown completed" ,
176- 		zap .String ("server" , s .name ),
177- 		zap .Duration ("total_duration" , time .Since (shutdownStart )))
178164}
179165
180166func  (s  * Server ) setupRPC () {
0 commit comments