Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/16/10 14:31:52 (13 years ago)
Author:
cneumuel
Message:

#1260

  • changed dependency discovery machanism: now all locally loaded plugins will be dependencies for a job.
  • fixed logging of slaveconsole by limiting the maximum log-messages
  • minor bug fixes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.ExecutionEngine/3.3/Executor.cs

    r4772 r4810  
    2828using HeuristicLab.Hive.JobBase;
    2929using HeuristicLab.Hive.Slave.Common;
     30using HeuristicLab.Persistence.Core;
    3031
    3132namespace HeuristicLab.Hive.Slave.ExecutionEngine {
     
    4950    public ExecutionState ExecutionState {
    5051      get {
    51         return Job.ExecutionState;
     52        return Job != null ? Job.ExecutionState : Core.ExecutionState.Stopped;
    5253      }
    5354    }
     
    5556    public TimeSpan ExecutionTime {
    5657      get {
    57         return Job.ExecutionTime;
     58        return Job != null ? Job.ExecutionTime : new TimeSpan(0, 0, 0);
    5859      }
    5960    }
     
    8485        }
    8586      }
    86       catch (OutOfMemoryException e) {
     87      catch (Exception e) {
    8788        this.currentException = e;
    8889        Queue.AddMessage(new MessageContainer(MessageContainer.MessageType.JobFailed, JobId));
     
    9495        Job.Start();
    9596      }
    96       catch (OutOfMemoryException e) {
     97      catch (Exception e) {
    9798        this.currentException = e;
    9899        Queue.AddMessage(new MessageContainer(MessageContainer.MessageType.JobFailed, JobId));
     
    133134          CoresNeeded = 1,
    134135          MemoryNeeded = 0,
    135           PluginsNeeded = HivePluginInfoDto.FindPluginsNeeded(e.Value.GetType()),
     136          PluginsNeeded = HivePluginInfoDto.FindPluginsNeeded(e.Value),
    136137        },
    137138        SerializedJobData = jobByteArray
     
    164165      HeuristicLab.Common.EventArgs<Exception> ex = (HeuristicLab.Common.EventArgs<Exception>)e;
    165166      currentException = ex.Value;
    166       Queue.AddMessage(new MessageContainer(MessageContainer.MessageType.FinishedJob, JobId));
     167      Queue.AddMessage(new MessageContainer(MessageContainer.MessageType.JobFailed, JobId));
    167168    }
    168169
     
    193194
    194195    public byte[] GetFinishedJob() {
    195       //Job isn't finished!
     196      if (Job == null)
     197        return new byte[0];
     198
    196199      if (Job.ExecutionState == Core.ExecutionState.Started) {
    197         throw new InvalidStateException("Job is still running");
    198       } else {
    199         byte[] jobArr = SerializedJob.Serialize(Job);
    200         return jobArr;
     200        throw new InvalidStateException("Job is still running"); //Job isn't finished!
     201      } else {
     202        return SerializedJob.Serialize(Job);
    201203      }
    202204    }
     
    208210
    209211    private void RestoreJobObject(byte[] sjob) {
    210       Job = SerializedJob.Deserialize<IJob>(sjob);
     212      try {
     213        Job = SerializedJob.Deserialize<IJob>(sjob);
     214      }
     215      catch {
     216        Job = null;
     217      }
    211218    }
    212219
     
    216223
    217224    public void Dispose() {
    218       DeregisterJobEvents();
     225      if(Job != null)
     226        DeregisterJobEvents();
    219227      Queue = null;
    220228      Job = null;
Note: See TracChangeset for help on using the changeset viewer.