-
Notifications
You must be signed in to change notification settings - Fork 44
Minor update fixes #382
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
Minor update fixes #382
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -253,19 +253,29 @@ public override async Task<WorkflowUpdateHandle<TUpdateResult>> StartUpdateWithS | |
| } | ||
| catch (Exception e) | ||
| { | ||
| // If this is a multi-operation failure, set exception to the first non-aborted | ||
| // If this is a multi-operation failure, set exception to the first present, | ||
| // non-OK, non-aborted error | ||
| if (e is RpcException rpcErr) | ||
| { | ||
| var status = rpcErr.GrpcStatus.Value; | ||
| if (status != null && status.Details.Count == 1) | ||
| { | ||
| if (status.Details[0].TryUnpack(out Api.ErrorDetails.V1.MultiOperationExecutionFailure failure)) | ||
| { | ||
| var nonAborted = failure.Statuses.FirstOrDefault(s => s.Details.Count == 0 || | ||
| !s.Details[0].Is(Api.Failure.V1.MultiOperationExecutionAborted.Descriptor)); | ||
| var grpcStatus = new GrpcStatus() { Code = nonAborted.Code, Message = nonAborted.Message }; | ||
| grpcStatus.Details.AddRange(nonAborted.Details); | ||
| e = new RpcException(grpcStatus); | ||
| var nonAborted = failure.Statuses.FirstOrDefault(s => | ||
| // Exists | ||
| s != null && | ||
| // Not ok | ||
| s.Code != (int)RpcException.StatusCode.OK && | ||
| // Not aborted | ||
| (s.Details.Count == 0 || | ||
| !s.Details[0].Is(Api.Failure.V1.MultiOperationExecutionAborted.Descriptor))); | ||
| if (nonAborted != null) | ||
| { | ||
| var grpcStatus = new GrpcStatus() { Code = nonAborted.Code, Message = nonAborted.Message }; | ||
| grpcStatus.Details.AddRange(nonAborted.Details); | ||
| e = new RpcException(grpcStatus); | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -462,7 +472,7 @@ public async override Task<WorkflowUpdateHandle<TResult>> StartWorkflowUpdateAsy | |
| // If the requested stage is completed, wait for result, but discard the update | ||
| // exception, that will come when _they_ call get result | ||
| var handle = new WorkflowUpdateHandle<TResult>( | ||
| Client, req.Request.Meta.UpdateId, input.Id, input.RunId) | ||
| Client, req.Request.Meta.UpdateId, input.Id, resp.UpdateRef.WorkflowExecution.RunId) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should really add a test for this. (I know the other fix is hard to test).
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added assertion to existing test that would have failed before (basically just ensures run ID now exists, because it was null before) |
||
| { KnownOutcome = resp.Outcome }; | ||
| if (input.Options.WaitForStage == WorkflowUpdateStage.Completed) | ||
| { | ||
|
|
||
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.
variable name could be
failureStatusor something, but not blocking.