Unverified Commit 0b864c7a authored by QuanluZhang's avatar QuanluZhang Committed by GitHub
Browse files

fix bug of state transition (#1077)

parent b19e36fd
...@@ -372,7 +372,7 @@ class NNIManager implements Manager { ...@@ -372,7 +372,7 @@ class NNIManager implements Manager {
private async periodicallyUpdateExecDuration(): Promise<void> { private async periodicallyUpdateExecDuration(): Promise<void> {
let count: number = 1; 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 await delay(1000 * 1); // 1 seconds
if (this.status.status === 'RUNNING') { if (this.status.status === 'RUNNING') {
this.experimentProfile.execDuration += 1; this.experimentProfile.execDuration += 1;
...@@ -461,7 +461,7 @@ class NNIManager implements Manager { ...@@ -461,7 +461,7 @@ class NNIManager implements Manager {
} }
let allFinishedTrialJobNum: number = this.currSubmittedTrialNum; let allFinishedTrialJobNum: number = this.currSubmittedTrialNum;
let waitSubmittedToFinish: number; 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(); const finishedTrialJobNum: number = await this.requestTrialJobsStatus();
allFinishedTrialJobNum += finishedTrialJobNum; allFinishedTrialJobNum += finishedTrialJobNum;
...@@ -671,7 +671,9 @@ class NNIManager implements Manager { ...@@ -671,7 +671,9 @@ class NNIManager implements Manager {
'ADD_HYPERPARAMETER', tunerCommand.trial_job_id, content, undefined); 'ADD_HYPERPARAMETER', tunerCommand.trial_job_id, content, undefined);
break; break;
case NO_MORE_TRIAL_JOBS: 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; break;
case KILL_TRIAL_JOB: case KILL_TRIAL_JOB:
this.log.info(`cancelTrialJob: ${JSON.parse(content)}`); this.log.info(`cancelTrialJob: ${JSON.parse(content)}`);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment