Skip to content

Conversation

@sophiatev
Copy link
Contributor

@sophiatev sophiatev commented Dec 4, 2025

Unfortunately I missed some things in this earlier PR. In particular, many fields of the instance entity were not being set in the case that no instance entity existed in the first place (and, in fact, I wasn't setting the output at all in any situation).

I also noticed I had other bugs. I actually should not be deleting the blob references in the call to synchronize the instance table with the history table. I misunderstood - the blobs should only be deleted in the case of a continue-as-new call when the history is overridden, which is never the case for an orchestration in a terminal state. I also updated the "input" and "output" fields of the instance entity to reference the blobs when appropriate. I also noticed that for the case of terminating a pending orchestration, the orchestration output was not set correctly if it was too large and needed to be stored in blob storage.

I also noticed some other places where fields were missing or incorrectly set (for example, for the case of a suborchestration, the tags, generation, and task hub name fields were not populated for the instance entity.

I made sure to add tests for synchronizing the instance and history tables for a failed and terminated orchestration (not just a completed one), and tested large inputs and outputs for all three of these cases. I also added tests for terminating a pending orchestration with a large output (termination reason).

Copy link
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

This PR adds missing fields to the instance entity tracking in Azure Storage, addressing several gaps identified in a previous PR. The changes ensure that instance entities are properly populated even when they don't exist initially (e.g., for suborchestrations that complete in one execution), and fix handling of large termination outputs stored in blob storage.

Key changes:

  • Refactored UpdateStatusForTerminationAsync to accept the full ExecutionTerminatedEvent instead of individual parameters, enabling proper handling of large outputs stored in blob storage
  • Added missing fields (Tags, Generation, TaskHubName) for suborchestration instance entities
  • Ensured all instance entity fields are populated in UpdateInstanceStatusAndDeleteOrphanedBlobsForCompletedOrchestrationAsync for cases where the entity was never created

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/DurableTask.AzureStorage/Tracking/ITrackingStore.cs Updated interface signature for UpdateStatusForTerminationAsync to accept ExecutionTerminatedEvent instead of separate parameters; fixed typo in documentation
src/DurableTask.AzureStorage/Tracking/TrackingStoreBase.cs Updated abstract method signature to match interface changes
src/DurableTask.AzureStorage/Tracking/AzureTableTrackingStore.cs Implemented proper blob storage handling for termination output; added missing fields (TaskHubName, Tags, Generation) for suborchestrations; populated all fields in completion method
src/DurableTask.AzureStorage/Tracking/InstanceStoreBackedTrackingStore.cs Updated implementation to use new method signature
src/DurableTask.AzureStorage/AzureStorageOrchestrationService.cs Updated call site to pass full ExecutionTerminatedEvent object

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

@sophiatev sophiatev changed the title Adding Missing Fields to Instance Entity Adding Missing Fields to Instance Entity and Fix Blob References Dec 4, 2025
…vents for large input/outputs to extract the blob names
Copy link
Member

@cgillum cgillum left a comment

Choose a reason for hiding this comment

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

This is fine, though I wonder if FirstOrDefault() would have been as good or a little better to avoid failures. But this is probably going to be an extreme corner case, so I'm not too worried about this.

@sophiatev sophiatev merged commit ee24d35 into main Dec 8, 2025
46 checks passed
@sophiatev sophiatev deleted the stevosyan/add-missing-fields-to-instance-table branch December 8, 2025 23:20
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.

3 participants