Skip to content

Harden Bulk Delete Error Handling#5666

Open
LTA-Thinking wants to merge 2 commits into
mainfrom
personal/rojo/bulk-delete-errors
Open

Harden Bulk Delete Error Handling#5666
LTA-Thinking wants to merge 2 commits into
mainfrom
personal/rojo/bulk-delete-errors

Conversation

@LTA-Thinking

Copy link
Copy Markdown
Contributor

Description

Catches exceptions that happen outside of parallel threads, preventing false reporting of job success.

Related issues

Addresses Bug 189017

Testing

New unit test

FHIR Team Checklist

  • Update the title of the PR to be succinct and less than 65 characters
  • Add a milestone to the PR for the sprint that it is merged (i.e. add S47)
  • Tag the PR with the type of update: Bug, Build, Dependencies, Enhancement, New-Feature or Documentation
  • Tag the PR with Open source, Azure API for FHIR (CosmosDB or common code) or Azure Healthcare APIs (SQL or common code) to specify where this change is intended to be released.
  • Tag the PR with Schema Version backward compatible or Schema Version backward incompatible or Schema Version unchanged if this adds or updates Sql script which is/is not backward compatible with the code.
  • When changing or adding behavior, if your code modifies the system design or changes design assumptions, please create and include an ADR.
  • CI is green before merge Build Status
  • Review squash-merge requirements

Semver Change (docs)

Patch|Skip|Feature|Breaking (reason)

@LTA-Thinking LTA-Thinking added this to the FY27\Q1\2wk\2wk01 milestone Jul 10, 2026
@LTA-Thinking
LTA-Thinking requested a review from a team as a code owner July 10, 2026 16:30
@LTA-Thinking LTA-Thinking added Bug Bug bug bug. Azure API for FHIR Label denotes that the issue or PR is relevant to the Azure API for FHIR Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs No-PaaS-breaking-change No-ADR ADR not needed labels Jul 10, 2026

// Verify that partial results contain the first page of deleted resources
Assert.NotNull(exception.PartialResults);
Assert.True(exception.PartialResults.ContainsKey("Patient"));
Comment on lines +444 to +451
catch (Exception ex)
{
_logger.LogError(ex, "Error soft deleting");
await CreateAuditLog(request.ResourceType, request.DeleteOperation, true, partialResults);
throw new IncompleteOperationException<Dictionary<string, long>>(
ex,
partialResults.GroupBy(pair => pair.ResourceType).ToDictionary(group => group.Key, group => (long)group.Count()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure API for FHIR Label denotes that the issue or PR is relevant to the Azure API for FHIR Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs Bug Bug bug bug. No-ADR ADR not needed No-PaaS-breaking-change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants