File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
packages/cli-v3/src/workers/dev Expand file tree Collapse file tree 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 {
627627 } ) ;
628628
629629 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 ) ;
630639 }
631640
632641 async executeTaskRun ( payload : TaskRunExecutionPayload ) : Promise < TaskRunExecutionResult > {
@@ -709,6 +718,8 @@ class TaskRunProcess {
709718 break ;
710719 }
711720 case "READY_TO_DISPOSE" : {
721+ logger . debug ( `[${ this . execution . run . id } ] task run process is ready to dispose` ) ;
722+
712723 this . #kill( ) ;
713724
714725 break ;
@@ -791,6 +802,8 @@ class TaskRunProcess {
791802
792803 #kill( ) {
793804 if ( this . _child && ! this . _child . killed ) {
805+ logger . debug ( `[${ this . execution . run . id } ] killing task run process` ) ;
806+
794807 this . _child ?. kill ( ) ;
795808 }
796809 }
You can’t perform that action at this time.
0 commit comments