mirror of
https://github.com/minio/minio.git
synced 2025-11-29 05:19:03 -05:00
Show SlowDown error message if backend is busy (#7521)
or if there are too many open file descriptors.
This commit is contained in:
@@ -136,3 +136,12 @@ func isSysErrCrossDevice(err error) bool {
|
||||
e, ok := err.(*os.LinkError)
|
||||
return ok && e.Err == syscall.EXDEV
|
||||
}
|
||||
|
||||
// Check if given error corresponds to too many open files
|
||||
func isSysErrTooManyFiles(err error) bool {
|
||||
if err == syscall.ENFILE || err == syscall.EMFILE {
|
||||
return true
|
||||
}
|
||||
pathErr, ok := err.(*os.PathError)
|
||||
return ok && (pathErr.Err == syscall.ENFILE || pathErr.Err == syscall.EMFILE)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user