File tree 2 files changed +18
-0
lines changed
packages/cli-v3/src/workers/dev 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " trigger.dev " : patch
3
+ ---
4
+
5
+ Add additional logging around cleaning up dev workers, and always kill them after 5 seconds if they haven't already exited
Original file line number Diff line number Diff line change @@ -627,6 +627,15 @@ class TaskRunProcess {
627
627
} ) ;
628
628
629
629
this . _isBeingKilled = kill ;
630
+
631
+ // Set a timeout to kill the child process if it hasn't been killed within 5 seconds
632
+ setTimeout ( ( ) => {
633
+ if ( this . _child && ! this . _child . killed ) {
634
+ logger . debug ( `[${ this . execution . run . id } ] killing task run process after timeout` ) ;
635
+
636
+ this . _child . kill ( ) ;
637
+ }
638
+ } , 5000 ) ;
630
639
}
631
640
632
641
async executeTaskRun ( payload : TaskRunExecutionPayload ) : Promise < TaskRunExecutionResult > {
@@ -709,6 +718,8 @@ class TaskRunProcess {
709
718
break ;
710
719
}
711
720
case "READY_TO_DISPOSE" : {
721
+ logger . debug ( `[${ this . execution . run . id } ] task run process is ready to dispose` ) ;
722
+
712
723
this . #kill( ) ;
713
724
714
725
break ;
@@ -791,6 +802,8 @@ class TaskRunProcess {
791
802
792
803
#kill( ) {
793
804
if ( this . _child && ! this . _child . killed ) {
805
+ logger . debug ( `[${ this . execution . run . id } ] killing task run process` ) ;
806
+
794
807
this . _child ?. kill ( ) ;
795
808
}
796
809
}
You can’t perform that action at this time.
0 commit comments