Changeset 11121 for stable/HeuristicLab.Clients.Hive.Slave/3.3/Manager
- Timestamp:
- 07/07/14 17:00:14 (10 years ago)
- Location:
- stable
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 11082,11113,11117
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Clients.Hive.Slave/3.3/Manager/ConfigManager.cs
r9456 r11121 117 117 st.JobsFetched = SlaveStatusInfo.TasksFetched; 118 118 st.JobsFailed = SlaveStatusInfo.TasksFailed; 119 st.ExceptionsOccured = SlaveStatusInfo.ExceptionsOccured;120 119 121 120 st.Jobs = jobManager.GetExecutionTimes().Select(x => new TaskStatus { TaskId = x.Key, ExecutionTime = x.Value }).ToList(); -
stable/HeuristicLab.Clients.Hive.Slave/3.3/Manager/HeartbeatManager.cs
r9456 r11121 24 24 using System.Threading; 25 25 using HeuristicLab.Clients.Hive.SlaveCore.Properties; 26 using HeuristicLab.Common;27 26 28 27 namespace HeuristicLab.Clients.Hive.SlaveCore { … … 115 114 if (msgs == null) { 116 115 SlaveClientCom.Instance.LogMessage("Error getting response from HB"); 117 OnExceptionOccured(new Exception("Error getting response from HB"));118 116 } else { 119 117 SlaveClientCom.Instance.LogMessage("HB Response received (" + msgs.Count + "): "); … … 126 124 catch (Exception e) { 127 125 SlaveClientCom.Instance.LogMessage("Heartbeat thread failed: " + e.ToString()); 128 OnExceptionOccured(e);129 126 } 130 127 waitHandle.WaitOne(this.interval); … … 132 129 SlaveClientCom.Instance.LogMessage("Heartbeat thread stopped"); 133 130 } 134 135 #region Eventhandler136 public event EventHandler<EventArgs<Exception>> ExceptionOccured;137 private void OnExceptionOccured(Exception e) {138 var handler = ExceptionOccured;139 if (handler != null) handler(this, new EventArgs<Exception>(e));140 }141 #endregion142 131 } 143 132 } -
stable/HeuristicLab.Clients.Hive.Slave/3.3/Manager/TaskManager.cs
r9456 r11121 71 71 try { 72 72 if (slaveTasks.ContainsKey(task.Id)) { 73 SlaveStatusInfo.Increment ExceptionOccured();73 SlaveStatusInfo.IncrementTasksFailed(); 74 74 throw new TaskAlreadyRunningException(task.Id); 75 75 } else { … … 185 185 slaveTask.TaskStopped += new EventHandler<EventArgs<Guid>>(slaveTask_TaskStopped); 186 186 slaveTask.TaskFailed += new EventHandler<EventArgs<Guid, Exception>>(slaveTask_TaskFailed); 187 slaveTask.ExceptionOccured += new EventHandler<EventArgs<Guid, Exception>>(slaveTask_ExceptionOccured);188 187 } 189 188 … … 193 192 slaveTask.TaskStopped -= new EventHandler<EventArgs<Guid>>(slaveTask_TaskStopped); 194 193 slaveTask.TaskFailed -= new EventHandler<EventArgs<Guid, Exception>>(slaveTask_TaskFailed); 195 slaveTask.ExceptionOccured -= new EventHandler<EventArgs<Guid, Exception>>(slaveTask_ExceptionOccured);196 194 } 197 195 … … 220 218 try { 221 219 taskData = slaveTask.GetTaskData(); 222 if (taskData == null) throw new SerializationException();223 220 SlaveStatusInfo.IncrementTasksFinished(); 224 221 OnTaskPaused(slaveTask, taskData); … … 243 240 try { 244 241 taskData = slaveTask.GetTaskData(); 245 if (taskData == null) throw new SerializationException();246 242 SlaveStatusInfo.IncrementTasksFinished(); 247 243 OnTaskStopped(slaveTask, taskData); … … 266 262 try { 267 263 taskData = slaveTask.GetTaskData(); 268 if (taskData == null) throw new SerializationException();269 264 } 270 265 catch { /* taskData will be null */ } 271 266 SlaveStatusInfo.IncrementTasksFailed(); 272 267 OnTaskFailed(slaveTask, taskData, e.Value2); 273 }274 275 private void slaveTask_ExceptionOccured(object sender, EventArgs<Guid, Exception> e) {276 SlaveTask slaveTask;277 slaveTasksLocker.EnterUpgradeableReadLock();278 try {279 slaveTask = slaveTasks[e.Value];280 RemoveSlaveTask(e.Value, slaveTask);281 }282 finally { slaveTasksLocker.ExitUpgradeableReadLock(); }283 284 SlaveStatusInfo.IncrementExceptionOccured();285 OnExceptionOccured(slaveTask, e.Value2);286 268 } 287 269 #endregion … … 312 294 } 313 295 314 public event EventHandler<EventArgs<SlaveTask, Exception>> ExceptionOccured;315 private void OnExceptionOccured(SlaveTask slaveTask, Exception exception) {316 var handler = ExceptionOccured;317 if (handler != null) handler(this, new EventArgs<SlaveTask, Exception>(slaveTask, exception));318 }319 320 296 public event EventHandler<EventArgs<SlaveTask>> TaskAborted; 321 297 private void OnTaskAborted(SlaveTask slaveTask) {
Note: See TracChangeset
for help on using the changeset viewer.