@@ -208,13 +208,16 @@ export class RunExecution {
208208 return ;
209209 }
210210
211- this . sendDebugLog ( `snapshot has changed to: ${ snapshot . executionStatus } ` , snapshotMetadata ) ;
211+ // DO NOT REMOVE (very noisy, but helpful for debugging)
212+ // this.sendDebugLog(`processing snapshot change: ${snapshot.executionStatus}`, snapshotMetadata);
212213
213214 // Reset the snapshot poll interval so we don't do unnecessary work
214215 this . snapshotPoller ?. resetCurrentInterval ( ) ;
215216
216217 switch ( snapshot . executionStatus ) {
217218 case "PENDING_CANCEL" : {
219+ this . sendDebugLog ( "run was cancelled" , snapshotMetadata ) ;
220+
218221 const [ error ] = await tryCatch ( this . cancel ( ) ) ;
219222
220223 if ( error ) {
@@ -279,13 +282,12 @@ export class RunExecution {
279282 return ;
280283 }
281284 case "EXECUTING" : {
282- this . sendDebugLog ( "run is now executing" , snapshotMetadata ) ;
283-
284285 if ( completedWaitpoints . length === 0 ) {
286+ this . sendDebugLog ( "run is executing without completed waitpoints" , snapshotMetadata ) ;
285287 return ;
286288 }
287289
288- this . sendDebugLog ( "processing completed waitpoints" , snapshotMetadata ) ;
290+ this . sendDebugLog ( "run is executing with completed waitpoints" , snapshotMetadata ) ;
289291
290292 if ( ! this . taskRunProcess ) {
291293 this . sendDebugLog ( "no task run process, ignoring completed waitpoints" , snapshotMetadata ) ;
@@ -301,7 +303,10 @@ export class RunExecution {
301303 return ;
302304 }
303305 case "RUN_CREATED" : {
304- this . sendDebugLog ( "invalid status change" , snapshotMetadata ) ;
306+ this . sendDebugLog (
307+ "aborting execution: invalid status change: RUN_CREATED" ,
308+ snapshotMetadata
309+ ) ;
305310
306311 this . abortExecution ( ) ;
307312 return ;
@@ -627,7 +632,7 @@ export class RunExecution {
627632 const snapshotStatus = this . convertAttemptStatusToSnapshotStatus ( result . attemptStatus ) ;
628633
629634 // Update our snapshot ID to match the completion result to ensure any subsequent API calls use the correct snapshot
630- this . updateSnapshot ( result . snapshot . friendlyId , snapshotStatus ) ;
635+ this . updateSnapshotAfterCompletion ( result . snapshot . friendlyId , snapshotStatus ) ;
631636
632637 const { attemptStatus } = result ;
633638
@@ -664,7 +669,7 @@ export class RunExecution {
664669 assertExhaustive ( attemptStatus ) ;
665670 }
666671
667- private updateSnapshot ( snapshotId : string , status : TaskRunExecutionStatus ) {
672+ private updateSnapshotAfterCompletion ( snapshotId : string , status : TaskRunExecutionStatus ) {
668673 this . snapshotManager ?. updateSnapshot ( snapshotId , status ) ;
669674 this . snapshotPoller ?. updateSnapshotId ( snapshotId ) ;
670675 }
@@ -1000,7 +1005,7 @@ export class RunExecution {
10001005 ) ;
10011006
10021007 if ( ! suspendResult . success ) {
1003- this . sendDebugLog ( "failed to suspend run , staying alive 🎶" , {
1008+ this . sendDebugLog ( "suspension request failed , staying alive 🎶" , {
10041009 suspendableSnapshot,
10051010 error : suspendResult . error ,
10061011 } ) ;
@@ -1010,7 +1015,7 @@ export class RunExecution {
10101015 }
10111016
10121017 if ( ! suspendResult . data . ok ) {
1013- this . sendDebugLog ( "checkpoint: failed to suspend run " , {
1018+ this . sendDebugLog ( "suspension request returned error, staying alive 🎶 " , {
10141019 suspendableSnapshot,
10151020 error : suspendResult . data . error ,
10161021 } ) ;
0 commit comments