Skip to content

Keep healthy queue messages processing when blob payloads are missing - #16

Open
Yan Mahdych (ymahdych) wants to merge 3 commits into
mainfrom
codex/blob-not-found-and-logging
Open

Yan Mahdych (ymahdych) wants to merge 3 commits into
mainfrom
codex/blob-not-found-and-logging

Conversation

@ymahdych

@ymahdych Yan Mahdych (ymahdych) commented Oct 30, 2026 •

Copy link
Copy Markdown

Closes https://github.com/youscan/youscan/issues/3502

  • Problem: One BlobNotFound fails the entire receive, forcing healthy messages to retry and eventually enter quarantine.
  • Fix: Delete and skip only the message with the missing blob, both during receive and transfer to quarantine. Healthy messages continue processing.
  • Logging: Add source-generated tracing of the blob/message lifecycle to investigate why BlobNotFound occurs and help determine whether these errors indicate data loss. Convert existing logs to source generation as well.

Delete main-queue messages whose payload returns 404 BlobNotFound,
including during transfer to quarantine, so healthy messages in
the same receive batch can continue processing.

Preserve handling of other storage errors and quarantine reads.
Add five regression cases to MessageQueueTests.

Verified all 19 MessageQueueTests against local Azurite.
Record blob and queue-message identities across upload, send, receive,
update, quarantine and deletion to investigate missing payloads and
shared references. Correlate logical sends with operation and Azure
request IDs, and record blob ETags and deletion results.

Move existing MessageQueue and TimerBatch events to source-generated
ILogger extensions while preserving their templates, levels and fields.

Verified all 36 tests against local Azurite and the full solution build.
Compared all 13 existing events through the consumer logging formatter;
output is unchanged except timestamp and EventId metadata.

var random = new Random().NextInt64(0, int.MaxValue);
BatchQueue = new BatchQueue<T>("UseDevelopmentStorage=true", $"batch-test-{random}", maxDequeueCount, logger: logger);
var connection = Environment.GetEnvironmentVariable("AZURE_BATCH_QUEUE_TEST_CONNECTION") ?? "UseDevelopmentStorage=true";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Environment.GetEnvironmentVariable("AZURE_BATCH_QUEUE_TEST_CONNECTION")

Yan Mahdych (@ymahdych) why do we need this though?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted

Remove the connection override introduced only for local investigation.
Keep both fixtures on the existing Azurite development-storage configuration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants