Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
change SIGKILL to SIGTERM in local mode cancel trial job (#3173)
Browse files Browse the repository at this point in the history
  • Loading branch information
J-shang authored Dec 15, 2020
1 parent 12a5e3d commit e9f832d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ts/nni_manager/training_service/local/localTrainingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,20 @@ class LocalTrainingService implements TrainingService {

return Promise.resolve();
}
tkill(trialJob.pid, 'SIGKILL');
tkill(trialJob.pid, 'SIGTERM');
const startTime = Date.now();
while(await isAlive(trialJob.pid)) {
if (Date.now() - startTime > 4999) {
tkill(trialJob.pid, 'SIGKILL', (err) => {
if (err) {
this.log.error(`kill trial job error: ${err}`);
}
});
break;
}
await delay(500);
}

this.setTrialJobStatus(trialJob, getJobCancelStatus(isEarlyStopped));

return Promise.resolve();
Expand Down

0 comments on commit e9f832d

Please sign in to comment.