Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(js): node executor address already in use #14023

Merged
merged 1 commit into from Dec 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/js/src/executors/node/node.impl.ts
Expand Up @@ -15,7 +15,7 @@ import { InspectType, NodeExecutorOptions } from './schema';

const hasher = new HashingImpl();
const processMap = new Map<string, ChildProcess>();
const hashedMap = new Map<string[], string>();
const hashedMap = new Map<string, string>();

export interface ExecutorEvent {
outfile: string;
Expand Down Expand Up @@ -92,7 +92,7 @@ async function runProcess(

const hashed = hasher.hashArray(execArgv.concat(options.args));

const hashedKey = [uniqueKey, ...options.args];
const hashedKey = JSON.stringify([uniqueKey, ...options.args]);
hashedMap.set(hashedKey, hashed);

const subProcess = fork(
Expand Down Expand Up @@ -166,7 +166,7 @@ async function killCurrentProcess(
options: NodeExecutorOptions,
signal: string = 'SIGTERM'
) {
const hashedKey = [uniqueKey, ...options.args];
const hashedKey = JSON.stringify([uniqueKey, ...options.args]);
const currentProcessKey = hashedMap.get(hashedKey);
if (!currentProcessKey) return;

Expand Down