Add opt-in Timeout to PurgeInstancesFilter for partial purge#680
Open
YunchuWang wants to merge 1 commit intomainfrom
Open
Add opt-in Timeout to PurgeInstancesFilter for partial purge#680YunchuWang wants to merge 1 commit intomainfrom
YunchuWang wants to merge 1 commit intomainfrom
Conversation
- Add TimeSpan? Timeout property to PurgeInstancesFilter (opt-in, default null) - Send timeout as google.protobuf.Duration in gRPC request when set - Add timeout field (4) to PurgeInstanceFilter proto message - Zero breaking changes: existing callers unaffected
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces an opt-in, per-call timeout for purge operations by extending the client-side PurgeInstancesFilter API and propagating the value through the gRPC contract to enable time-bounded (“partial”) purge behavior when supported by the backend.
Changes:
- Add
TimeSpan? Timeout(init-only) toPurgeInstancesFilter. - Send
Timeoutasgoogle.protobuf.DurationinGrpcDurableTaskClient.PurgeAllInstancesAsyncwhen provided. - Extend the gRPC proto
PurgeInstanceFiltermessage with a newtimeoutfield.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Client/Core/PurgeInstancesFilter.cs | Adds the new optional Timeout property and XML documentation. |
| src/Client/Grpc/GrpcDurableTaskClient.cs | Maps PurgeInstancesFilter.Timeout into the gRPC request message. |
| src/Grpc/orchestrator_service.proto | Extends PurgeInstanceFilter with google.protobuf.Duration timeout = 4. |
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+491
to
+494
| if (filter?.Timeout is not null) | ||
| { | ||
| request.PurgeInstanceFilter.Timeout = Google.Protobuf.WellKnownTypes.Duration.FromTimeSpan(filter.Timeout.Value); | ||
| } |
Comment on lines
+491
to
+494
| if (filter?.Timeout is not null) | ||
| { | ||
| request.PurgeInstanceFilter.Timeout = Google.Protobuf.WellKnownTypes.Duration.FromTimeSpan(filter.Timeout.Value); | ||
| } |
Comment on lines
+19
to
+22
| /// If <c>null</c> (default), all matching instances are purged with no time limit. | ||
| /// When set, the purge stops accepting new instances after this duration elapses | ||
| /// and returns with <see cref="PurgeResult.IsComplete"/> set to <c>false</c>. | ||
| /// Already-started instance deletions will complete before the method returns. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add opt-in
TimeSpan? Timeoutproperty toPurgeInstancesFilterand send it asgoogle.protobuf.Durationin the gRPC proto request.Changes
PurgeInstancesFilter: AddTimeSpan? Timeout { get; init; }property (default null)GrpcDurableTaskClient.PurgeAllInstancesAsync: Send timeout asgoogle.protobuf.Durationin proto when setgoogle.protobuf.Duration timeout = 4toPurgeInstanceFiltermessageUsage
Breaking Changes
None.
Timeoutdefaults to null — existing behavior unchanged.Replaces #679 (closed).
Dependencies