Compare commits

...

3 Commits

Author SHA1 Message Date
houseme c37ed7f8e7 Merge branch 'main' into overtrue/backlog-1831-heal-dead-variants 2026-08-13 17:06:47 +08:00
cxymds 2ac61ff4bb Merge branch 'main' into overtrue/backlog-1831-heal-dead-variants 2026-08-13 15:28:29 +08:00
overtrue 0e37cd22ac chore(heal): remove seven dead error variants
heal::Error carried six variants with zero construction and zero match sites (ConfigurationError, NotFound, TaskAlreadyExists, ManagerNotRunning, EventProcessingFailed, ProgressTrackingFailed) plus IO(String), which was never constructed either — its only appearances were two or-pattern match arms that could never fire (task.rs's demotion match and the recoverability classifier). All seven are deleted and the two or-patterns lose their dead alternative.

Config(String) stays (live, four construction sites); Io(std::io::Error) stays; the retry classifier's behavior is untouched per the issue constraint — removing an arm that can never match is not a classification change.

Ref rustfs/backlog#1831 (PR3).
2026-08-13 02:08:49 +08:00
2 changed files with 2 additions and 25 deletions
+1 -24
View File
@@ -34,36 +34,21 @@ pub enum Error {
#[error("Configuration error: {0}")]
Config(String),
#[error("Heal configuration error: {message}")]
ConfigurationError { message: String },
#[error("Other error: {0}")]
Other(String),
#[error("Serialization error: {0}")]
Serialization(String),
#[error("IO error: {0}")]
IO(String),
#[error("Not found: {0}")]
NotFound(String),
#[error("Invalid checkpoint: {0}")]
InvalidCheckpoint(String),
#[error("Heal task not found: {task_id}")]
TaskNotFound { task_id: String },
#[error("Heal task already exists: {task_id}")]
TaskAlreadyExists { task_id: String },
#[error("Invalid heal client token")]
InvalidClientToken,
#[error("Heal manager is not running")]
ManagerNotRunning,
#[error("Heal task execution failed: {message}")]
TaskExecutionFailed { message: String },
@@ -78,12 +63,6 @@ pub enum Error {
#[error("Heal task timeout")]
TaskTimeout,
#[error("Heal event processing failed: {message}")]
EventProcessingFailed { message: String },
#[error("Heal progress tracking failed: {message}")]
ProgressTrackingFailed { message: String },
}
/// A specialized Result type for heal operations
@@ -129,9 +108,7 @@ impl Error {
| DiskError::FaultyDisk
) || is_recoverable_heal_error_message(&err.to_string())
}
Error::TaskExecutionFailed { message } | Error::IO(message) | Error::Other(message) => {
is_recoverable_heal_error_message(message)
}
Error::TaskExecutionFailed { message } | Error::Other(message) => is_recoverable_heal_error_message(message),
Error::Io(err) => is_recoverable_heal_error_message(&err.to_string()),
_ => false,
}
+1 -1
View File
@@ -597,7 +597,7 @@ impl HealTask {
| EcstoreError::ObjectNotFound(_, _)
| EcstoreError::VersionNotFound(_, _, _),
) => true,
Error::Other(message) | Error::IO(message) => {
Error::Other(message) => {
message.contains("File not found")
|| message.contains("file not found")
|| message.contains("File version not found")