Check if experiment can transition before setting new status
@@ -220,6 +220,7 @@ class Experiment(DiffModel,
def set_status(self, status, message=None, traceback=None, **kwargs):
if status in ExperimentLifeCycle.HEARTBEAT_STATUS:
RedisHeartBeat.experiment_ping(self.id)
+ if ExperimentLifeCycle.can_transition(status_from=self.last_status, status_to=status):
ExperimentStatus.objects.create(experiment=self,
status=status,
message=message,
