Ignore:
Timestamp:
07/03/14 16:03:14 (5 years ago)
Author:
ascheibe
Message:

#2153

  • added a new method HandleStartStopPauseError in Executor to handle error conditions in the same way
  • added timeouts for semaphores so that failed tasks or tasks with endless loops don't block the slave
  • removed ExceptionOccured events from Executor/SlaveTask/TaskManager and use TaskFailed instead
  • removed another ExcpetionOccured event in HeartbeatManager that was never used
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Hive.Slave/3.3/Core.cs

    r9456 r11082  
    204204      TS.Task.Factory.StartNew(HandleCalculateTask, jobId)
    205205      .ContinueWith((t) => {
    206         SlaveStatusInfo.IncrementExceptionOccured();
     206        SlaveStatusInfo.IncrementTasksFailed();
    207207        SlaveClientCom.Instance.LogMessage(t.Exception.ToString());
    208208      }, TaskContinuationOptions.OnlyOnFaulted);
     
    212212      TS.Task.Factory.StartNew(HandleStopTask, jobId)
    213213       .ContinueWith((t) => {
    214          SlaveStatusInfo.IncrementExceptionOccured();
     214         SlaveStatusInfo.IncrementTasksFailed();
    215215         SlaveClientCom.Instance.LogMessage(t.Exception.ToString());
    216216       }, TaskContinuationOptions.OnlyOnFaulted);
     
    220220      TS.Task.Factory.StartNew(HandlePauseTask, jobId)
    221221       .ContinueWith((t) => {
    222          SlaveStatusInfo.IncrementExceptionOccured();
     222         SlaveStatusInfo.IncrementTasksFailed();
    223223         SlaveClientCom.Instance.LogMessage(t.Exception.ToString());
    224224       }, TaskContinuationOptions.OnlyOnFaulted);
     
    228228      TS.Task.Factory.StartNew(HandleAbortTask, jobId)
    229229       .ContinueWith((t) => {
    230          SlaveStatusInfo.IncrementExceptionOccured();
     230         SlaveStatusInfo.IncrementTasksFailed();
    231231         SlaveClientCom.Instance.LogMessage(t.Exception.ToString());
    232232       }, TaskContinuationOptions.OnlyOnFaulted);
     
    328328      this.taskManager.TaskStopped += new EventHandler<EventArgs<SlaveTask, TaskData>>(taskManager_TaskStopped);
    329329      this.taskManager.TaskFailed += new EventHandler<EventArgs<Tuple<SlaveTask, TaskData, Exception>>>(taskManager_TaskFailed);
    330       this.taskManager.ExceptionOccured += new EventHandler<EventArgs<SlaveTask, Exception>>(taskManager_ExceptionOccured);
    331330      this.taskManager.TaskAborted += new EventHandler<EventArgs<SlaveTask>>(taskManager_TaskAborted);
    332331    }
     
    391390      }
    392391      catch (TaskNotFoundException ex) {
    393         SlaveStatusInfo.IncrementExceptionOccured();
     392        SlaveStatusInfo.IncrementTasksFailed();
    394393        SlaveClientCom.Instance.LogMessage(ex.ToString());
    395394      }
    396395      catch (Exception ex) {
    397         SlaveStatusInfo.IncrementExceptionOccured();
     396        SlaveStatusInfo.IncrementTasksFailed();
    398397        SlaveClientCom.Instance.LogMessage(ex.ToString());
    399398      }
    400     }
    401 
    402     private void taskManager_ExceptionOccured(object sender, EventArgs<SlaveTask, Exception> e) {
    403       SlaveStatusInfo.DecrementUsedCores(e.Value.CoresNeeded);
    404       SlaveStatusInfo.IncrementExceptionOccured();
    405       heartbeatManager.AwakeHeartBeatThread();
    406       SlaveClientCom.Instance.LogMessage(string.Format("Exception occured for task {0}: {1}", e.Value.TaskId, e.Value2.ToString()));
    407       wcfService.UpdateJobState(e.Value.TaskId, TaskState.Waiting, e.Value2.ToString());
    408399    }
    409400
Note: See TracChangeset for help on using the changeset viewer.