Skip to content

out_azure_blob: correctly handle successful Delete Blob responses#11925

Open
Vaibhav-C-S wants to merge 1 commit into
fluent:masterfrom
Vaibhav-C-S:out-azure-blob-delete-status-v2
Open

out_azure_blob: correctly handle successful Delete Blob responses#11925
Vaibhav-C-S wants to merge 1 commit into
fluent:masterfrom
Vaibhav-C-S:out-azure-blob-delete-status-v2

Conversation

@Vaibhav-C-S

@Vaibhav-C-S Vaibhav-C-S commented Jun 6, 2026

Copy link
Copy Markdown

Fixes an incorrect success status check in the Azure Blob output delete path.

Azure Blob Storage Delete Blob returns HTTP 202 Accepted on success, but delete_blob() was checking for HTTP 201 Created. This caused successful delete responses in the stale/aborted buffered-file cleanup path to be treated as failures.

Reference:
https://learn.microsoft.com/en-us/rest/api/storageservices/delete-blob

No issue.

Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
[SERVICE]
    Flush        1
    Log_Level    debug

[INPUT]
    Name   dummy
    Tag    test.azure
    Dummy  {"message":"test"}
    Rate   1
[OUTPUT]
    Name                azure_blob
    Match               test.azure
    account_name        testaccount
    shared_key          dGVzdGtleWZvcmF6dXJlYmxvYnRlc3Rpbmc=
    container_name      testcontainer
    blob_type           blockblob
    endpoint            http://127.0.0.1:8080
    emulator_mode       on
    buffering_enabled   true
    database_file       /tmp/flb_azure_delete_test.db
    upload_timeout      2s
    upload_parts_timeout 2s
    file_delivery_attempt_limit 1
    part_delivery_attempt_limit 1
    delete_on_max_upload_error on
    upload_file_size    1048576
    part_size           262144
  • Debug log output from testing the change

Tested locally with a mock Azure Blob endpoint returning HTTP 202 for DELETE requests. Since delete_blob() is reached through the database-backed stale/aborted cleanup path, I inserted an aborted file row into the local Azure Blob buffering database to trigger that path.

Before this change, Fluent Bit treated the 202 response as a failure:

[error] [output:azure_blob:azure_blob.0] http_status=202 cannot delete append blob

After this change, Fluent Bit accepted the 202 response as successful:

[ info] [output:azure_blob:azure_blob.0] blob deleted successfully: /testaccount/testcontainer/test.azure/manual-delete-test
  • [N/A] Attached Valgrind output that shows no leaks or memory corruption was found
    This change only updates the expected HTTP success status code for Azure Blob delete responses. It does not add allocations or change memory ownership.

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • [N/A] Run local packaging test showing all targets (including any new ones) build.
  • [N/A] Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • [N/A] Documentation required for this feature

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected Azure Blob Storage deletion status handling to properly recognize successful blob removal operations.

Signed-off-by: Vaibhav-C-S <vaibhavsharma.c@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Azure Blob Storage output plugin's delete_blob() function is updated to treat HTTP status 202 (Accepted) as success rather than 201 (Created). This aligns the response validation with Azure's actual async delete operation behavior.

Changes

Azure Blob Delete Status Code

Layer / File(s) Summary
Delete blob HTTP status validation
plugins/out_azure_blob/azure_blob.c
delete_blob() now checks for HTTP status 202 instead of 201 as the success condition, matching Azure Blob Storage's async delete operation response.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A single digit shift in the code,
From 201's old abode,
To 202, accepted and free,
Azure blobs deleted with glee! 🐰💨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately describes the main change: updating the Azure Blob output plugin to correctly handle HTTP 202 responses for Delete Blob operations.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Vaibhav-C-S Vaibhav-C-S changed the title out_azure_blob: fix delete blob success status out_azure_blob: correctly handle successful Delete Blob responses Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant