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

🏗 Make nailgun server stoppage a time-bound operation and log errors if any #24648

Merged
merged 1 commit into from Sep 20, 2019
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
10 changes: 8 additions & 2 deletions build-system/tasks/nailgun.js
Expand Up @@ -35,6 +35,7 @@ const DEFAULT_NAILGUN_PORT = '2113';
const CHECK_TYPES_NAILGUN_PORT = '2114';
const DIST_NAILGUN_PORT = '2115';
const NAILGUN_STARTUP_TIMEOUT_MS = 5 * 1000;
const NAILGUN_STOP_TIMEOUT_MS = 5 * 1000;

/**
* Replaces the default compiler binary with nailgun on linux and macos
Expand Down Expand Up @@ -142,16 +143,21 @@ async function stopNailgunServer(port) {
}
if (process.platform == 'darwin' || process.platform == 'linux') {
const stopNailgunServerCmd = `${nailgunRunner} --nailgun-port ${port} ng-stop`;
if (exec(stopNailgunServerCmd, {stdio: 'pipe'}).status == 0) {
const stopped = exec(stopNailgunServerCmd, {
stdio: 'pipe',
timeout: NAILGUN_STOP_TIMEOUT_MS,
});
if (stopped.status == 0) {
log('Stopped', cyan('nailgun-server.jar'), 'on port', cyan(port));
} else {
log(
yellow('WARNING:'),
'Could not find a running instance of',
'Could not stop',
cyan('nailgun-server.jar'),
'on port',
cyan(port)
);
log(red(stopped.stderr));
}
}
}
Expand Down