Skip to content

Commit 819ab17

Browse files
mayastor-borstiagolobocastro
mayastor-bors
andcommitted
Merge #1736
1736: fix: invalid error code on locked resource r=tiagolobocastro a=tiagolobocastro Return aborted rather than already exists... Co-authored-by: Tiago Castro <tiagolobocastro@gmail.com>
2 parents 5b36521 + 57330d8 commit 819ab17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

io-engine/src/grpc/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,14 @@ pub async fn acquire_subsystem_lock<'a>(
202202
if let Some(resource) = resource {
203203
match subsystem.lock_resource(resource.to_string(), None, true).await {
204204
Some(lock_guard) => Ok(lock_guard),
205-
None => Err(Status::already_exists(format!(
205+
None => Err(Status::aborted(format!(
206206
"Failed to acquire lock for the resource: {resource}, lock already held"
207207
))),
208208
}
209209
} else {
210210
match subsystem.lock(None, true).await {
211211
Some(lock_guard) => Ok(lock_guard),
212-
None => Err(Status::already_exists(format!(
212+
None => Err(Status::aborted(format!(
213213
"Failed to acquire subsystem lock: {subsystem:?}, lock already held",
214214
))),
215215
}

0 commit comments

Comments
 (0)