- 
                Notifications
    
You must be signed in to change notification settings  - Fork 138
 
Activity reset #1730
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
Activity reset #1730
Changes from all commits
156fd42
              6d3d364
              600a776
              1aeb11a
              051ea89
              cf9ecfc
              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 | 
|---|---|---|
| 
          
            
          
           | 
    @@ -149,9 +149,14 @@ export class Activity { | |
| (error instanceof CancelledFailure || isAbortError(error)) && | ||
| this.context.cancellationSignal.aborted | ||
| ) { | ||
| if (this.context.cancellationDetails?.paused) { | ||
| if (this.context.cancellationDetails?.cancelRequested) { | ||
| this.workerLogger.debug('Activity completed as cancelled', { durationMs }); | ||
| } else if (this.context.cancellationDetails?.reset) { | ||
| this.workerLogger.debug('Activity reset', { durationMs }); | ||
| } else if (this.context.cancellationDetails?.paused) { | ||
| this.workerLogger.debug('Activity paused', { durationMs }); | ||
| } else { | ||
| // Fallback log - completed as cancelled. | ||
| this.workerLogger.debug('Activity completed as cancelled', { durationMs }); | ||
| } | ||
| } else if (error instanceof CompleteAsyncError) { | ||
| 
          
            
          
           | 
    @@ -204,8 +209,17 @@ export class Activity { | |
| } else if (this.cancelReason) { | ||
| // Either a CancelledFailure that we threw or AbortError from AbortController | ||
| if (err instanceof CancelledFailure) { | ||
| // If cancel due to activity pause, emit an application failure for the pause. | ||
| if (this.context.cancellationDetails?.paused) { | ||
| // If cancel due to activity pause or reset, emit an application failure. | ||
| if (this.context.cancellationDetails?.reset) { | ||
| 
         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. Are we confident on if clause ordering? reset vs pause? 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. Between reset and pause yes. Added a conditional for explicit cancellations, ordered before the   | 
||
| return { | ||
| failed: { | ||
| failure: await encodeErrorToFailure( | ||
| this.dataConverter, | ||
| new ApplicationFailure('Activity reset', 'ActivityReset') | ||
| 
         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. 
 I'm a bit concerned here that  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. 
 I'm less concerned about using  The alternative is we don't wrap and we emit a  Whatever choice we make, we should also apply to the  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. @Sushisource wdyt 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. IMO what Java (wrap with more specific types) is probably the most sensible. But I agree we'd need to apply it to Python and pause as well. You should get @dandavison 's take and coordinate Python change with him 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. @tconley1428 is working on activity reset right now 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. Then him, hehe 😅 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. After some discussion - we'll leave this as is.  | 
||
| ), | ||
| }, | ||
| }; | ||
| } else if (this.context.cancellationDetails?.paused) { | ||
| return { | ||
| failed: { | ||
| failure: await encodeErrorToFailure( | ||
| 
          
            
          
           | 
    ||
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.
Do we have any tests where multiple things are true at once? EX: Paused and reset?
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.
added