File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -151,10 +151,16 @@ export class DeepnoteServerStarter implements IDeepnoteServerStarter {
151151 const serverInfo = { url, port } ;
152152 this . serverInfos . set ( fileKey , serverInfo ) ;
153153
154- const serverReady = await this . waitForServer ( serverInfo , 30000 , token ) ;
155- if ( ! serverReady ) {
154+ try {
155+ const serverReady = await this . waitForServer ( serverInfo , 30000 , token ) ;
156+ if ( ! serverReady ) {
157+ await this . stopServerImpl ( deepnoteFileUri ) ;
158+ throw new Error ( 'Deepnote server failed to start within timeout period' ) ;
159+ }
160+ } catch ( error ) {
161+ // Clean up leaked server before rethrowing
156162 await this . stopServerImpl ( deepnoteFileUri ) ;
157- throw new Error ( 'Deepnote server failed to start within timeout period' ) ;
163+ throw error ;
158164 }
159165
160166 logger . info ( `Deepnote server started successfully at ${ url } for ${ fileKey } ` ) ;
You can’t perform that action at this time.
0 commit comments