TennyZhuang commented on issue #4654:
URL: https://github.com/apache/opendal/issues/4654#issuecomment-2140685110

   Reproduced by rust client.
   
   ```rust
   use opendal::{layers::LoggingLayer, services, Operator};
   
   #[tokio::main]
   async fn main() {
       let mut builder = services::S3::default();
       builder
           .bucket("test1");
       let op = Operator::new(builder)
           .unwrap()
           .layer(LoggingLayer::default())
           .finish();
       op.remove_all("scripts").await.unwrap();
       dbg!(op.list("/").await.unwrap());
   }
   ```
   
   Just take a look at the implementation, and I guess it's likely because 
there is no the terminology `dir` in S3 (and other object stores), then 
`S3Backend::stat` with a `prefix` argument will always returns a `NotFound`.
   
   
https://github.com/apache/opendal/blob/dd70b3c706f1689c2fe9455405cbd1e773c483ab/core/src/services/s3/backend.rs#L1090-L1099
   
   Then the `remove_all` implementation will go to a happy path here:
   
   
https://github.com/apache/opendal/blob/dd70b3c706f1689c2fe9455405cbd1e773c483ab/core/src/types/operator/blocking_operator.rs#L852
   
   A simple solution: don't stat here, and handle `NotFound` error after call 
lister.


-- 
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