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 {
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;
......@@ -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;
......@@ -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)}`);
......
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