Changeset 6381 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs
- Timestamp:
- 06/08/11 00:04:16 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs
r6371 r6381 228 228 Guid jobId = (Guid)jobIdObj; 229 229 Job job = null; 230 bool usedCoresIncremented = false;230 int usedCores = 0; 231 231 try { 232 232 job = wcfService.GetJob(jobId); … … 234 234 if (ConfigManager.Instance.GetFreeCores() < job.CoresNeeded) throw new OutOfCoresException(); 235 235 if (ConfigManager.GetFreeMemory() < job.MemoryNeeded) throw new OutOfMemoryException(); 236 SlaveStatusInfo.IncrementUsedCores(job.CoresNeeded); usedCores Incremented = true;236 SlaveStatusInfo.IncrementUsedCores(job.CoresNeeded); usedCores = job.CoresNeeded; 237 237 JobData jobData = wcfService.GetJobData(jobId); 238 238 if (jobData == null) throw new JobDataNotFoundException(jobId); … … 242 242 } 243 243 catch (JobNotFoundException) { 244 if (usedCoresIncremented) SlaveStatusInfo.DecrementUsedCores(job.CoresNeeded);244 SlaveStatusInfo.DecrementUsedCores(usedCores); 245 245 throw; 246 246 } 247 247 catch (JobDataNotFoundException) { 248 SlaveStatusInfo.DecrementUsedCores( job.CoresNeeded);248 SlaveStatusInfo.DecrementUsedCores(usedCores); 249 249 throw; 250 250 } 251 251 catch (JobAlreadyRunningException) { 252 SlaveStatusInfo.DecrementUsedCores( job.CoresNeeded);252 SlaveStatusInfo.DecrementUsedCores(usedCores); 253 253 throw; 254 254 } … … 261 261 throw; 262 262 } 263 catch (Exception) { 264 if (usedCoresIncremented) SlaveStatusInfo.DecrementUsedCores(job.CoresNeeded); 263 catch (Exception e) { 264 SlaveStatusInfo.DecrementUsedCores(usedCores); 265 wcfService.UpdateJobState(jobId, JobState.Waiting, e.ToString()); // unknown internal error - report and set waiting again 265 266 throw; 266 267 } … … 372 373 job.ExecutionTime = slaveJob.ExecutionTime; 373 374 if (jobData != null) { 374 wcfService.UpdateJobData(job, jobData, configManager.GetClientInfo().Id, JobState.Failed );375 wcfService.UpdateJobData(job, jobData, configManager.GetClientInfo().Id, JobState.Failed, exception.ToString()); 375 376 } else { 376 377 wcfService.UpdateJobState(job.Id, JobState.Failed, exception.ToString());
Note: See TracChangeset
for help on using the changeset viewer.