File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
apps/webapp/app/v3/services Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import { CreateCheckpointService } from "./createCheckpoint.server";
3131import { FinalizeTaskRunService } from "./finalizeTaskRun.server" ;
3232import { RetryAttemptService } from "./retryAttempt.server" ;
3333import { getTaskEventStoreTableForRun } from "../taskEventStore.server" ;
34+ import { socketIo } from "../handleSocketIo.server" ;
3435
3536type FoundAttempt = Awaited < ReturnType < typeof findAttempt > > ;
3637
@@ -504,6 +505,14 @@ export class CompleteAttemptService extends BaseService {
504505
505506 if ( forceRequeue ) {
506507 logger . debug ( "[CompleteAttemptService] Forcing retry via queue" , { runId : run . id } ) ;
508+
509+ // The run won't know it should shut down as we make the decision to force requeue here
510+ // This also ensures that this change is backwards compatible with older workers
511+ socketIo . coordinatorNamespace . emit ( "REQUEST_RUN_CANCELLATION" , {
512+ version : "v1" ,
513+ runId : run . id ,
514+ } ) ;
515+
507516 await retryViaQueue ( ) ;
508517 return ;
509518 }
You can’t perform that action at this time.
0 commit comments