Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6100


Ignore:
Timestamp:
05/02/11 17:56:52 (14 years ago)
Author:
ascheibe
Message:

#1233

  • Executor now sends all exceptions to the ExperimentManager as NetNamedPipe communication won't be possible in a Sandbox due to security constraints
  • count stopped and aborted jobs correctly
  • send correct status when a job is stopped by the ExperimentManager
  • try to log unhandled exceptions to gui if no EventLog is available
  • don't crash if job is sent more than once by server
Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs

    r6039 r6100  
    9696          catch (Exception) { }
    9797        } else {
    98           throw ex;
     98          //try to log with clientCom. if this works the user sees at least a message,
     99          //else an exception will be thrown anyways.
     100          clientCom.LogMessage("Error on startup: " + ex.ToString() +
     101            Environment.NewLine + "Core is going to shutdown.");
    99102        }
    100103      }
     
    187190            break;
    188191          case MessageContainer.MessageType.AbortJob:
     192            SlaveStatusInfo.JobsAborted++;
    189193            KillAppDomain(container.JobId);
    190194            break;
     
    222226
    223227          try {
     228            if (engines[job.Id].CurrentException != string.Empty) {
     229              wcfService.UpdateJobState(job.Id, JobState.Failed, engines[job.Id].CurrentException);
     230              SlaveStatusInfo.JobsAborted++;
     231            } else {
     232              SlaveStatusInfo.JobsProcessed++;
     233            }
    224234            clientCom.LogMessage("Sending the paused job with id: " + job.Id);
    225235            wcfService.UpdateJobData(job, sJob, ConfigManager.Instance.GetClientInfo().Id, JobState.Paused);
     
    246256          job.ExecutionTime = engines[job.Id].ExecutionTime;
    247257
     258
    248259          try {
     260            if (engines[job.Id].CurrentException != string.Empty) {
     261              wcfService.UpdateJobState(job.Id, JobState.Failed, engines[job.Id].CurrentException);
     262            }
     263            SlaveStatusInfo.JobsAborted++;
     264
    249265            clientCom.LogMessage("Sending the stoppped job with id: " + job.Id);
    250             wcfService.UpdateJobData(job, sJob, ConfigManager.Instance.GetClientInfo().Id, JobState.Finished);
     266            wcfService.UpdateJobData(job, sJob, ConfigManager.Instance.GetClientInfo().Id, JobState.Aborted);
    251267          }
    252268          catch (Exception e) {
     
    440456
    441457      lock (locker) {
    442         if (engines.ContainsKey(myJob.Id))
    443           throw new Exception("Job with key " + myJob.Id + " already exists");
     458        if (engines.ContainsKey(myJob.Id)) {
     459          clientCom.LogMessage("Job with key " + myJob.Id + " already exists. Job will be ignored.");
     460          return;
     461        }
    444462
    445463        String pluginDir = Path.Combine(PluginCache.Instance.PluginTempBaseDir, myJob.Id.ToString());
     
    476494              engine.Start(jobData.Data);
    477495            }
     496
    478497          }
    479498          catch (Exception exception) {
     
    544563                repeat--;
    545564                if (repeat == 0) {
     565                  clientCom.LogMessage("Could not unload AppDomain, shutting down core...");
    546566                  throw; // rethrow and let app crash
    547567                }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Executor.cs

    r6004 r6100  
    9898      SendHeartbeatForExecutor = false;
    9999      if (Job == null) {
    100         SlaveClientCom.Instance.ClientCom.LogMessage("Pausing job: Job is null");
     100        currentException = new Exception("Pausing job " + this.JobId + ": Job is null");
    101101        Core.EnqueueExecutorMessage(Core.KillAppDomain, JobId);
    102102      }
     
    109109        }
    110110        catch (Exception ex) {
    111           SlaveClientCom.Instance.ClientCom.LogMessage("Error pausing job:" + ex.ToString());
     111          currentException = new Exception("Error pausing job " + this.JobId + ": " + ex.ToString());
    112112        }
    113113      }
     
    117117      SendHeartbeatForExecutor = false;
    118118      if (Job == null) {
    119         SlaveClientCom.Instance.ClientCom.LogMessage("Stopping job: Job is null");
     119        currentException = new Exception("Stopping job " + this.JobId + ": Job is null");
    120120        Core.EnqueueExecutorMessage(Core.KillAppDomain, JobId);
    121121      }
     
    128128        }
    129129        catch (Exception ex) {
    130           SlaveClientCom.Instance.ClientCom.LogMessage("Error stopping job:" + ex.ToString());
     130          currentException = new Exception("Error stopping job " + this.JobId + ": " + ex.ToString());
    131131        }
    132132      }
     
    207207    public JobData GetFinishedJob() {
    208208      if (Job == null) {
    209         SlaveClientCom.Instance.ClientCom.LogMessage("Getting finished job: Job is null");
     209        if (currentException == null) {
     210          currentException = new Exception("Getting finished job " + this.JobId + ": Job is null");
     211        }
    210212        Core.EnqueueExecutorMessage(Core.KillAppDomain, JobId);
    211213      }
     
    218220        }
    219221        catch (Exception ex) {
    220           SlaveClientCom.Instance.ClientCom.LogMessage("Error stopping job:" + ex.ToString());
     222          currentException = new Exception("Error getting finished job " + this.JobId + ": " + ex.ToString());
    221223        }
    222224      }
Note: See TracChangeset for help on using the changeset viewer.