Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/03/11 18:08:42 (13 years ago)
Author:
ascheibe
Message:

#1233

  • HeartbeatManager: don't sleep while starting jobs
  • Executor: make Start() blocking
  • shutdown properly if an uncaught exception is thrown
File:
1 edited

Legend:

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

    r6110 r6112  
    100100          //try to log with clientCom. if this works the user sees at least a message,
    101101          //else an exception will be thrown anyways.
    102           clientCom.LogMessage("Error on startup: " + ex.ToString() +
     102          clientCom.LogMessage("Uncaught exception: " + ex.ToString() +
    103103            Environment.NewLine + "Core is going to shutdown.");
    104104        }
     105        ShutdownCore();
    105106      }
    106107      finally {
     
    177178              // handle exception of task
    178179              clientCom.LogMessage(t.Exception.ToString());
     180              wcfService.UpdateJobState(container.JobId, JobState.Failed, t.Exception.ToString());
     181              SlaveStatusInfo.JobsAborted++;
    179182            }, TaskContinuationOptions.OnlyOnFaulted);
    180183            break;
     
    474477        catch (Exception exception) {
    475478          clientCom.LogMessage(string.Format("Copying plugins for job {0} failed: {1}", myJob.Id, exception));
     479          wcfService.UpdateJobState(myJob.Id, JobState.Failed, exception.ToString());
     480          SlaveStatusInfo.JobsAborted++;
    476481          lock (executors) {
    477482            if (jobs.ContainsKey(myJob.Id)) {
     
    493498            executor.Core = this;
    494499            clientCom.LogMessage("Starting Executor for job " + myJob.Id);
    495 
    496500            executor.Start(jobData.Data);
    497            
     501
    498502            lock (executors) {
    499503              executors.Add(myJob.Id, executor);
     
    503507            clientCom.LogMessage("Creating the Appdomain and loading the job failed for job " + myJob.Id);
    504508            clientCom.LogMessage("Error thrown is: " + exception.ToString());
     509
     510            if (executors.ContainsKey(myJob.Id) && executors[myJob.Id].CurrentException != string.Empty) {
     511              wcfService.UpdateJobState(myJob.Id, JobState.Failed, executors[myJob.Id].CurrentException);
     512            } else {
     513              wcfService.UpdateJobState(myJob.Id, JobState.Failed, exception.ToString());
     514            }
     515            SlaveStatusInfo.JobsAborted++;
     516
    505517            KillAppDomain(myJob.Id);
    506518          }
Note: See TracChangeset for help on using the changeset viewer.