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

fix bug of state transition #1077

Merged
merged 1 commit into from
May 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/nni_manager/core/nnimanager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class NNIManager implements Manager {

private async periodicallyUpdateExecDuration(): Promise<void> {
let count: number = 1;
while (this.status.status !== 'STOPPING' && this.status.status !== 'STOPPED') {
while (!['ERROR', 'STOPPING', 'STOPPED'].includes(this.status.status)) {
await delay(1000 * 1); // 1 seconds
if (this.status.status === 'RUNNING') {
this.experimentProfile.execDuration += 1;
Expand Down Expand Up @@ -461,7 +461,7 @@ class NNIManager implements Manager {
}
let allFinishedTrialJobNum: number = this.currSubmittedTrialNum;
let waitSubmittedToFinish: number;
while (this.status.status !== 'STOPPING' && this.status.status !== 'STOPPED') {
while (!['ERROR', 'STOPPING', 'STOPPED'].includes(this.status.status)) {
const finishedTrialJobNum: number = await this.requestTrialJobsStatus();
allFinishedTrialJobNum += finishedTrialJobNum;

Expand Down Expand Up @@ -671,7 +671,9 @@ class NNIManager implements Manager {
'ADD_HYPERPARAMETER', tunerCommand.trial_job_id, content, undefined);
break;
case NO_MORE_TRIAL_JOBS:
this.setStatus('TUNER_NO_MORE_TRIAL');
if (!['ERROR', 'STOPPING', 'STOPPED'].includes(this.status.status)) {
this.setStatus('TUNER_NO_MORE_TRIAL');
}
break;
case KILL_TRIAL_JOB:
this.log.info(`cancelTrialJob: ${JSON.parse(content)}`);
Expand Down