Changeset 16622
- Timestamp:
- 02/27/19 12:44:11 (6 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Clients.Hive.Slave/3.3/Core.cs
r16565 r16622 38 38 /// </summary> 39 39 public class Core : MarshalByRefObject { 40 private static readonly object locker = new object(); 41 40 42 private static HeartbeatManager heartbeatManager; 41 43 public static HeartbeatManager HeartbeatManager { … … 240 242 task = wcfService.GetTask(taskId); 241 243 if (task == null) throw new TaskNotFoundException(taskId); 242 if (ConfigManager.Instance.GetFreeCores() < task.CoresNeeded) throw new OutOfCoresException(); 243 if (ConfigManager.Instance.GetFreeMemory() < task.MemoryNeeded) throw new OutOfMemoryException(); 244 SlaveStatusInfo.IncrementUsedCores(task.CoresNeeded); usedCores = task.CoresNeeded; 244 lock (locker) { 245 // the amount of used cores/memory could exceed the amount of available cores/memory 246 // if HandleCalculateTask is called simultaneously from within two different tasks 247 if (ConfigManager.Instance.GetFreeCores() < task.CoresNeeded) throw new OutOfCoresException(); 248 if (ConfigManager.Instance.GetFreeMemory() < task.MemoryNeeded) throw new OutOfMemoryException(); 249 SlaveStatusInfo.IncrementUsedCores(task.CoresNeeded); usedCores = task.CoresNeeded; 250 } 245 251 TaskData taskData = wcfService.GetTaskData(taskId); 246 252 if (taskData == null) throw new TaskDataNotFoundException(taskId); … … 400 406 401 407 private void taskManager_TaskAborted(object sender, EventArgs<SlaveTask> e) { 408 var slaveTask = e.Value; 409 var task = wcfService.GetTask(slaveTask.TaskId); 410 wcfService.UpdateJobState(task.Id, TaskState.Aborted, null); 402 411 SlaveStatusInfo.DecrementUsedCores(e.Value.CoresNeeded); 403 412 } -
trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/JobDao.cs
r16565 r16622 88 88 (from job in db.GetTable<Job>() 89 89 where job.State == JobState.StatisticsPending 90 && (from task in db.GetTable<Task>()91 where task.JobId == job.JobId92 select task.State == TaskState.Finished93 || task.State == TaskState.Aborted94 || task.State == TaskState.Failed).All(x => x)90 && (from task in db.GetTable<Task>() 91 where task.JobId == job.JobId 92 select task).All(x => x.State == TaskState.Finished 93 || x.State == TaskState.Aborted 94 || x.State == TaskState.Failed) 95 95 select job)); 96 96 #endregion -
trunk/HeuristicLab.Services.Hive/3.3/HiveStatisticsGenerator.cs
r16565 r16622 66 66 67 67 pm.UseTransaction(() => { 68 UpdateFactTaskTable(pm);69 68 try { 70 pm.SubmitChanges();69 UpdateFactTaskTable(pm); 71 70 UpdateExistingDimJobs(pm); 71 FlagJobsForDeletion(pm); 72 72 pm.SubmitChanges(); 73 73 } … … 81 81 }); 82 82 } 83 84 pm.UseTransaction(() => {85 FlagJobsForDeletion(pm);86 pm.SubmitChanges();87 });88 83 } 89 84 }
Note: See TracChangeset
for help on using the changeset viewer.