Copilot commented on code in PR #7908:
URL: https://github.com/apache/opendal/pull/7908#discussion_r3567990927


##########
core/core/src/types/operator/registry.rs:
##########
@@ -71,8 +92,11 @@ impl OperatorRegistry {
             .get(scheme)
             .copied()
             .ok_or_else(|| {
+                let mut available: Vec<String> = 
self.schemes().into_iter().collect();
+                available.sort();
                 Error::new(ErrorKind::Unsupported, "scheme is not registered")
                     .with_context("scheme", scheme.to_string())

Review Comment:
   `load()` holds `self.factories` mutex while calling `ok_or_else(...)`. 
Inside that closure it calls `self.schemes()`, which tries to lock the same 
mutex again, causing a self-deadlock on the unsupported-scheme path (and will 
hang the added unit test). Collect the available schemes from the existing 
guard, or drop the guard before calling `schemes()`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to