- Timestamp:
- 07/03/14 16:03:14 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Hive.Slave/3.3/SlaveTask.cs
r9456 r11082 43 43 public Guid TaskId { get; private set; } 44 44 public bool IsPrepared { get; private set; } 45 private TaskData originalTaskData; 45 46 46 47 private int coresNeeded; … … 74 75 try { 75 76 this.TaskId = task.Id; 77 originalTaskData = taskData; 76 78 Prepare(task); 77 79 StartTaskInAppDomain(taskData); … … 143 145 while (repeat > 0) { 144 146 try { 145 waitForStartBeforeKillSem.WaitOne( );147 waitForStartBeforeKillSem.WaitOne(Settings.Default.ExecutorSemTimeouts); 146 148 AppDomain.Unload(appDomain); 147 149 waitForStartBeforeKillSem.Dispose(); … … 164 166 private void AppDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { 165 167 DisposeAppDomain(); 166 On ExceptionOccured(new Exception("Unhandled exception: " + e.ExceptionObject.ToString()));168 OnTaskFailed(new Exception("Unhandled exception: " + e.ExceptionObject.ToString())); 167 169 } 168 170 … … 171 173 try { 172 174 data = executor.GetTaskData(); 175 //this means that there was a problem executing the task 176 if (data == null) return originalTaskData; 173 177 } 174 178 catch (Exception ex) { … … 233 237 executorMonitoringRun = false; 234 238 break; 235 236 case ExecutorMessageType.ExceptionOccured:237 executorMonitoringRun = false;238 DisposeAppDomain();239 if (executor.CurrentException != null) {240 OnExceptionOccured(executor.CurrentException);241 } else {242 OnExceptionOccured(new Exception(string.Format("Unknow exception occured in Executor for task {0}", TaskId)));243 }244 break;245 239 } 246 240 } … … 277 271 if (handler != null) handler(this, new EventArgs<Guid, Exception>(this.TaskId, exception)); 278 272 } 279 280 public event EventHandler<EventArgs<Guid, Exception>> ExceptionOccured;281 private void OnExceptionOccured(Exception exception) {282 var handler = ExceptionOccured;283 if (handler != null) handler(this, new EventArgs<Guid, Exception>(this.TaskId, exception));284 }285 273 } 286 274 }
Note: See TracChangeset
for help on using the changeset viewer.