-
Notifications
You must be signed in to change notification settings - Fork 284
Add API to get orchestration history in .NET Isolated #3268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
nytian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Overall looks good to me and I will go back here once the dotnet sdk is released. Left some small comments.
| { | ||
| return false; | ||
| } | ||
| return other.CallEntities == this.CallEntities |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you fix the indexing here?
| jsonHistory, | ||
| new JsonSerializerSettings() | ||
| { | ||
| // I had to make the HistoryEventJsonConverter public to use it here. Is this a good reason? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe try InternalsVisibleTo attribute?
| /// <returns>The enumerable of history chunks representing the orchestration's history.</returns> | ||
| public virtual Task<IEnumerable<string>> StreamOrchestrationHistoryAsync(string instanceId, JsonFormatter jsonFormatter, CancellationToken cancellationToken) | ||
| { | ||
| throw this.GetNotImplementedException(nameof(this.StreamOrchestrationHistoryAsync)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we would expect a PR at other backends repo? Can you link those in the PR description too when they are done?
| [Trait("Python", "Skip")] // The GetOrchestrationHistory API is not implemented in Python | ||
| [Trait("PowerShell", "Skip")] // The GetOrchestrationHistory API is not implemented in PowerShell | ||
| [Trait("Node", "Skip")] // The GetOrchestrationHistory API is not implemented in Node | ||
| public async Task GetOrchestrationHistory_FailedOrchestration() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a brief description of the test coverage scenario?
| /// <inheritdoc/> | ||
| public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer) | ||
| { | ||
| throw new NotImplementedException(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't support write because we don't need this converter to write, right?
This PR introduces the server-side implementation of a new API to retrieve orchestration history in .NET isolated. The client-side implementation is in this PR.
The server-side call is implemented in the
TaskHubGrpcServer. We also introduce a new method to stream the orchestration history in theDurabilityProvider. If the backend (so far only DTS) has an orchestration history streaming API implemented, then we will use that. If not, we will fall back to the "old method" (retrieving a JSON string of the orchestration history, deserializing it, converting it to protos, and sending that).Note:
The method added to the
DurabilityProviderclass returns an enumerable of strings. Ideally, this would be an enumerable of the proto objects that we can then just forward on to the client. However, I get a "CS0050: Return type is less accessible than the method" error if I try to do this. That being said, we now have an extra unnecessary level of serialization introduced because of this (the backend converts the protos to strings, and theTaskHubGrpcServerconverts these strings back to the same protos before sending them to the client).Issue describing the changes in this PR
resolves #issue_for_this_pr
Pull request checklist
pending_docs.mdrelease_notes.md/src/Worker.Extensions.DurableTask/AssemblyInfo.csdevandmainbranches and will not be merged into thev2.xbranch.