eskabetxe commented on code in PR #29420:
URL: https://github.com/apache/flink/pull/29420#discussion_r4790299603
##########
flink-filesystems/flink-s3-fs-native/src/main/java/org/apache/flink/fs/s3native/NativeS3FileSystem.java:
##########
@@ -387,6 +425,12 @@ public boolean delete(Path path, boolean recursive) throws
IOException {
final String key = S3UriUtils.extractKey(path);
final S3Client s3Client = clientProvider.getS3Client();
+ if (key.isEmpty()) {
+ // The bucket root resolves to a directory status; deleting it
would either wipe the
+ // whole bucket or silently no-op. Match S3A and refuse.
Review Comment:
Changed to log a warning and return false instead of throwing; the test now
asserts false and that bucket contents survive.
##########
flink-filesystems/flink-s3-fs-native/src/main/java/org/apache/flink/fs/s3native/NativeS3FileSystem.java:
##########
@@ -387,6 +425,12 @@ public boolean delete(Path path, boolean recursive) throws
IOException {
final String key = S3UriUtils.extractKey(path);
final S3Client s3Client = clientProvider.getS3Client();
+ if (key.isEmpty()) {
+ // The bucket root resolves to a directory status; deleting it
would either wipe the
+ // whole bucket or silently no-op. Match S3A and refuse.
Review Comment:
Changed to log a warning and return false instead of throwing, the test now
asserts false and that bucket contents survive.
--
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]