[BUG] DataLakeFileSystemAsyncClient.createIfNotExists returns true when the file system already exists

オープン
#51,145 コメント 2 件 リアクション 1 件 担当者 2 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@browndav-msft がすでに取り組んでいます。

2026年11月6日 から。

評価

この issue はまだ評価されていません。

説明

Client customer-reported needs-team-attention question Storage

Describe the bug
DataLakeFileSystemAsyncClient.createIfNotExists() emits true when the file system already exists (409). The sync DataLakeFileSystemClient.createIfNotExists() correctly returns false, and so does BlobContainerAsyncClient.createIfNotExists().

Root cause
In azure-storage-file-datalake 12.26.4, DataLakeFileSystemAsyncClient.createIfNotExistsWithResponse(Map, PublicAccessType) maps the result of BlobContainerAsyncClient.createIfNotExistsWithResponse(...) with a lambda equivalent to:

response -> new SimpleResponse<>(response, true)

So the value is always true. The status code of the wrapped response is still 409 when the file system already exists.

To Reproduce
Point the async DataLake client at a server that answers every request with 409 and call createIfNotExists().

Code Snippet

HttpServer server = HttpServer.create(new InetSocketAddress("127.0.0.1", 0), 0);
server.createContext("/", exchange -> { exchange.sendResponseHeaders(409, -1); exchange.close(); });
server.start();

DataLakeServiceClientBuilder builder = new DataLakeServiceClientBuilder()
    .endpoint("http://127.0.0.1:" + server.getAddress().getPort() + "/devstoreaccount1")
    .credential(new StorageSharedKeyCredential("devstoreaccount1",
        "Eby8vdM02xNOcqCfGfP/mkP3+rZTt5tF5If1fMvj08QzZLOiT4E5lZaz0smU4wFwbIsrpPoIQx=="));

System.out.println(builder.buildClient().getFileSystemClient("fs").createIfNotExists());                 // false
System.out.println(builder.buildAsyncClient().getFileSystemAsyncClient("fs").createIfNotExists().block()); // true

Expected behavior
The async client returns false when the file system already exists, matching the sync client and BlobContainerAsyncClient.

Workaround
Call createIfNotExistsWithResponse(null, null) and check getStatusCode() != 409.

Setup

  • OS: Ubuntu 20.04 (x86_64)
  • Library/Libraries: azure-storage-file-datalake 12.26.4, azure-storage-blob 12.36.0
  • Java version: 25 (GraalVM 25.0.4)
  • Frameworks: none

Information Checklist

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
主要言語
Java
スター
2.6k
フォーク
2.2k
平均マージ
2日 2時間
マージ済み PR(30日)
257

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Azure/azure-sdk-for-java のほかの issue

Azure/azure-sdk-for-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。