Skip to content

Fix invalidblocklist debug call#3394

Open
adreed-msft wants to merge 1 commit intomainfrom
adreed/fix-invalidblocklist-log
Open

Fix invalidblocklist debug call#3394
adreed-msft wants to merge 1 commit intomainfrom
adreed/fix-invalidblocklist-log

Conversation

@adreed-msft
Copy link
Copy Markdown
Member

Description

  • Feature / Bug Fix: Corrects an order-of-operations error when trying to output InvalidBlockList detail logs. We accidentally cancel the transfer before we try to grab the block list and compare. This means we instantly fail the call, every time. This is a quick fix to assist in the amex-ediscovery case.

Type of Change

  • Bug fix
  • New feature
  • Documentation update required
  • Code quality improvement
  • Other (describe):

How Has This Been Tested?

Testing with eDiscovery PG to validate, since we have a reliable repro of the bug that causes this.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes an order-of-operations issue in blockBlobSenderBase.Epilogue() so InvalidBlockList diagnostics can run before FailActiveSend cancels the transfer context, enabling collection of block list delta details for troubleshooting.

Changes:

  • Defers jptm.FailActiveSend(...) until after InvalidBlockList diagnostic block list retrieval/logging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +332 to +334
// Fail _afterwards_, since this is the action that cancels our context. Unfortunately, doing this would cause us to fail to send the request that'd get us details on the block list.
jptm.FailActiveSend(common.Iff(blobTags != nil, "Committing block list (with tags)", "Committing block list"), err)

Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

Now that FailActiveSend is delayed until after the InvalidBlockList diagnostics, any latency/hang in the GetBlockList call (or subsequent formatting) will delay marking the transfer failed/canceling the context. Consider running the diagnostic GetBlockList under a short, bounded timeout context (best-effort) so this debug path can’t stall epilogue/failure propagation.

Copilot uses AI. Check for mistakes.
Comment on lines +332 to +334
// Fail _afterwards_, since this is the action that cancels our context. Unfortunately, doing this would cause us to fail to send the request that'd get us details on the block list.
jptm.FailActiveSend(common.Iff(blobTags != nil, "Committing block list (with tags)", "Committing block list"), err)

Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

With this change, the InvalidBlockList diagnostic logging will actually execute before failing. That path currently logs the full blockIDs slice and builds block ID lists via repeated string concatenation, which can become extremely large/slow (comment notes up to 50k blocks) and can bloat log files. Consider limiting/summarizing at error level (counts + a small sample) and only emitting full lists when debug logging is enabled, and use a builder-based formatter to avoid O(n^2) concatenation costs.

Copilot uses AI. Check for mistakes.
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