quantranhong1999 commented on code in PR #3197:
URL: https://github.com/apache/james-project/pull/3197#discussion_r4119348451
##########
server/blob/blob-file/src/main/java/org/apache/james/blob/file/FileBlobStoreDAO.java:
##########
@@ -216,8 +221,10 @@ public Publisher<Void> delete(BucketName bucketName,
Collection<BlobId> blobIds)
@Override
public Mono<Void> deleteBucket(BucketName bucketName) {
return Mono.fromRunnable(Throwing.runnable(() -> {
- File bucketRoot = new File(root, bucketName.asString());
- FileUtils.deleteQuietly(bucketRoot);
+ File bucketRoot = getBucketRoot(bucketName);
Review Comment:
Thanks, the path guard and file lock points are addressed. But now that
`getBucketRoot` creates the directory again, `deleteBucket` creates the bucket
before deleting it. With concurrent calls, `forceMkdir` fails when another
thread deletes the directory in between.
`deleteBucketConcurrentlyShouldNotFail` fails locally in
`FileBlobStoreDAOTest`, `FileBlobStorePassThroughTest` and
`FileWithFolderHierarchyTest` with `ObjectStoreIOException: Cannot create
bucket`.
Could `deleteBucket` go back to `new File(root, bucketName.asString())` like
on master? Then the `exists()` checks in `deleteBucket` and `listBlobs` aren't
needed anymore either.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]