mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 09:35:38 -05:00
Notebooks: More Jupyter Server Hardening (#5264)
* Do not rely on same starting port every time, misc * put back to 5 seconds for process kill timeout * extHostNotebook shutdown manager handle
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
import * as net from 'net';
|
||||
|
||||
export class StrictPortFindOptions {
|
||||
constructor(public startPort: number, public minPort: number, public maxport: number) {
|
||||
constructor(public minPort: number, public maxport: number) {
|
||||
}
|
||||
public maxRetriesPerStartPort: number = 5;
|
||||
public totalRetryLoops: number = 10;
|
||||
@@ -21,7 +21,7 @@ export class StrictPortFindOptions {
|
||||
*/
|
||||
export async function strictFindFreePort(options: StrictPortFindOptions): Promise<number> {
|
||||
let totalRetries = options.totalRetryLoops;
|
||||
let startPort = options.startPort;
|
||||
let startPort = getRandomInt(options.minPort, options.maxport);
|
||||
let port = await findFreePort(startPort, options.maxRetriesPerStartPort, options.timeout);
|
||||
while (port === 0 && totalRetries > 0) {
|
||||
startPort = getRandomInt(options.minPort, options.maxport);
|
||||
|
||||
Reference in New Issue
Block a user