| 55 | } |
| 56 | |
| 57 | bool ErrorConverter::IsBlacklistableError(int err_no) { |
| 58 | // A set of disk IO related non-transient error codes that should cause failure for |
| 59 | // reading/writing file on local disk. These errors could be caused by incorrect |
| 60 | // configurations or file system errors, but are not caused by temporarily unavailable |
| 61 | // resource, like EAGAIN, ENOMEM, EMFILE, ENFILE and ENOSPC. Since these errors are not |
| 62 | // likely disappear soon, the node which frequently hits such disk errors should be |
| 63 | // blacklisted. |
| 64 | static const set<int32_t> blacklistable_disk_error_codes = { |
| 65 | EPERM, // Operation not permitted. |
| 66 | ENOENT, // No such file or directory. |
| 67 | ESRCH, // No such process. |
| 68 | EINTR, // Interrupted system call. |
| 69 | EIO, // Disk level I/O error. |
| 70 | ENXIO, // No such device or address. |
| 71 | E2BIG, // Argument list too long. |
| 72 | ENOEXEC, // Exec format error. |
| 73 | EBADF, // The given file descriptor is invalid. |
| 74 | EACCES, // Permission denied. |
| 75 | EFAULT, // Bad address. |
| 76 | ENODEV, // No such device |
| 77 | ENOTDIR, // It is not a directory. |
| 78 | EINVAL, // Invalid argument. |
| 79 | EFBIG, // Maximum file size reached. |
| 80 | ESPIPE, // Illegal seek. |
| 81 | EROFS, // The file system is read only. |
| 82 | ENAMETOOLONG, // Either the path length or a path component exceeds the max length. |
| 83 | EOVERFLOW}; // File size can't be represented. |
| 84 | |
| 85 | // Return true if the err_no matches any of the 'blacklistable' error code. |
| 86 | return (blacklistable_disk_error_codes.find(err_no) |
| 87 | != blacklistable_disk_error_codes.end()); |
| 88 | } |
| 89 | |
| 90 | bool ErrorConverter::IsBlacklistableError(const Status& status) { |
| 91 | // Return true if the error is generated by Debug Action. |
nothing calls this directly
no test coverage detected