Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/08/11 00:04:16 (13 years ago)
Author:
cneumuel
Message:

#1233

  • locking for childHiveJobs in OptimizerHiveJob avoid multi threaded access issues
  • added IsPrivileged to gui
  • minor changes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs

    r6371 r6381  
    228228      Guid jobId = (Guid)jobIdObj;
    229229      Job job = null;
    230       bool usedCoresIncremented = false;
     230      int usedCores = 0;
    231231      try {
    232232        job = wcfService.GetJob(jobId);
     
    234234        if (ConfigManager.Instance.GetFreeCores() < job.CoresNeeded) throw new OutOfCoresException();
    235235        if (ConfigManager.GetFreeMemory() < job.MemoryNeeded) throw new OutOfMemoryException();
    236         SlaveStatusInfo.IncrementUsedCores(job.CoresNeeded); usedCoresIncremented = true;
     236        SlaveStatusInfo.IncrementUsedCores(job.CoresNeeded); usedCores = job.CoresNeeded;
    237237        JobData jobData = wcfService.GetJobData(jobId);
    238238        if (jobData == null) throw new JobDataNotFoundException(jobId);
     
    242242      }
    243243      catch (JobNotFoundException) {
    244         if (usedCoresIncremented) SlaveStatusInfo.DecrementUsedCores(job.CoresNeeded);
     244        SlaveStatusInfo.DecrementUsedCores(usedCores);
    245245        throw;
    246246      }
    247247      catch (JobDataNotFoundException) {
    248         SlaveStatusInfo.DecrementUsedCores(job.CoresNeeded);
     248        SlaveStatusInfo.DecrementUsedCores(usedCores);
    249249        throw;
    250250      }
    251251      catch (JobAlreadyRunningException) {
    252         SlaveStatusInfo.DecrementUsedCores(job.CoresNeeded);
     252        SlaveStatusInfo.DecrementUsedCores(usedCores);
    253253        throw;
    254254      }
     
    261261        throw;
    262262      }
    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
    265266        throw;
    266267      }
     
    372373        job.ExecutionTime = slaveJob.ExecutionTime;
    373374        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());
    375376        } else {
    376377          wcfService.UpdateJobState(job.Id, JobState.Failed, exception.ToString());
Note: See TracChangeset for help on using the changeset viewer.