This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -464,7 +464,9 @@ export class Miniflare {
464
464
verbose : this . #sharedOpts. core . verbose ,
465
465
} ;
466
466
this . #runtime = new Runtime ( opts ) ;
467
- this . #removeRuntimeExitHook = exitHook ( ( ) => void this . #runtime?. dispose ( ) ) ;
467
+ this . #removeRuntimeExitHook = exitHook (
468
+ ( ) => void this . #runtime?. dispose ( /* force */ true )
469
+ ) ;
468
470
469
471
// Update config and wait for runtime to start
470
472
await this . #assembleAndUpdateConfig( /* initial */ true ) ;
Original file line number Diff line number Diff line change @@ -134,14 +134,14 @@ export class Runtime {
134
134
return this . #processExitPromise;
135
135
}
136
136
137
- dispose ( ) : Awaitable < void > {
137
+ dispose ( force = false ) : Awaitable < void > {
138
138
// `kill()` uses `SIGTERM` by default. In `workerd`, this waits for HTTP
139
139
// connections to close before exiting. Notably, Chrome sometimes keeps
140
140
// connections open for about 10s, blocking exit. We'd like `dispose()`/
141
141
// `setOptions()` to immediately terminate the existing process.
142
142
// Therefore, use `SIGINT` which force closes all connections.
143
143
// See https://github.com/cloudflare/workerd/pull/244.
144
- this . #process?. kill ( "SIGINT" ) ;
144
+ this . #process?. kill ( force ? "SIGKILL" : "SIGINT" ) ;
145
145
return this . #processExitPromise;
146
146
}
147
147
}
You can’t perform that action at this time.
0 commit comments