mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-09-18 20:40:54 +02:00
ctx.Done()
This commit is contained in:
@@ -146,9 +146,9 @@ func (s *Server) Close() error {
|
||||
select {
|
||||
case <-done:
|
||||
// Normal shutdown
|
||||
case <-time.After(2 * time.Second):
|
||||
case <-time.After(1 * time.Second):
|
||||
// Timeout - force shutdown
|
||||
glog.Warningf("Server shutdown timed out after 2 seconds, forcing close")
|
||||
glog.Warningf("Server shutdown timed out after 1 second, forcing close")
|
||||
}
|
||||
|
||||
// Close the handler (important for SeaweedMQ mode)
|
||||
|
||||
@@ -324,6 +324,10 @@ func (h *Handler) HandleConn(ctx context.Context, conn net.Conn) error {
|
||||
default:
|
||||
// Already completed
|
||||
}
|
||||
case <-ctx.Done():
|
||||
// Context cancelled, exit timeout goroutine
|
||||
fmt.Printf("DEBUG: [%s] Force timeout goroutine cancelled due to context\n", connectionID)
|
||||
return
|
||||
case <-done:
|
||||
// Operation completed, exit timeout goroutine
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user