File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -200,7 +200,8 @@ export const acquireServerOwnership = Effect.fn("acquireServerOwnership")(functi
200200 }
201201 const db = new NodeSqlite . DatabaseSync ( lockPath ) ;
202202 try {
203- db . exec ( "PRAGMA busy_timeout = 0; BEGIN EXCLUSIVE;" ) ;
203+ // An idle service launcher probes this lock for a moment; wait out that probe.
204+ db . exec ( "PRAGMA busy_timeout = 250; BEGIN EXCLUSIVE;" ) ;
204205 const identity = NodeFS . statSync ( lockPath , { bigint : true } ) ;
205206 return {
206207 db,
Original file line number Diff line number Diff line change @@ -565,6 +565,8 @@ export class Launcher {
565565 this . #enqueue( async ( ) => {
566566 // Let in-progress updates start replacements first; replacements observe the marker and own pre-activation tunnel cleanup.
567567 this . #stopping = true ;
568+ // An exit-78 transition queued before this one may have started the owner poll.
569+ this . #clearTimer( ) ;
568570 const child = this . #child?. process ;
569571 this . #child = null ;
570572 if ( child !== undefined ) await terminateChild ( child , signal ) ;
@@ -852,7 +854,11 @@ export class Launcher {
852854 }
853855
854856 async #reclaimStateDir( ) : Promise < void > {
855- if ( this . #timer === undefined || this . #child !== null || this . #stopRequested) return ;
857+ if ( this . #stopRequested) {
858+ this . #clearTimer( ) ;
859+ return ;
860+ }
861+ if ( this . #timer === undefined || this . #child !== null ) return ;
856862 if ( stateDirOwned ( this . #baseDir) ) return ;
857863 this . #clearTimer( ) ;
858864 process . stderr . write ( "[service-launcher] The T3 home is free again. Starting the server.\n" ) ;
You can’t perform that action at this time.
0 commit comments