mirror of
https://github.com/pgsty/minio.git
synced 2026-07-22 21:50:22 +03:00
fix: for frozen calls return if client disconnects (#15062)
This commit is contained in:
+6
-1
@@ -247,7 +247,12 @@ func maxClients(f http.HandlerFunc) http.HandlerFunc {
|
|||||||
if val := globalServiceFreeze.Load(); val != nil {
|
if val := globalServiceFreeze.Load(); val != nil {
|
||||||
if unlock, ok := val.(chan struct{}); ok && unlock != nil {
|
if unlock, ok := val.(chan struct{}); ok && unlock != nil {
|
||||||
// Wait until unfrozen.
|
// Wait until unfrozen.
|
||||||
<-unlock
|
select {
|
||||||
|
case <-unlock:
|
||||||
|
case <-r.Context().Done():
|
||||||
|
// if client canceled we don't need to wait here forever.
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user