mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-02 18:22:40 +01:00
ctx.Done()
This commit is contained in:
1 parent
e501abcde6
commit
58eb40db01
2 files changed
+6
-2
No files matched your search
@@ -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