Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/19/11 23:21:21 (13 years ago)
Author:
cneumuel
Message:

#1233

  • stability improvements for HiveExperiment and HiveEngine
  • parallelized upload of jobs
  • enabled cancellation of job upload
  • reduced the amount of double-assignment of jobs by an additional check in HeartbeatManager
  • tried to tackle the amount of deadlocks by automatically rerunning transactions
  • some fixes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HeartbeatManager.cs

    r6431 r6444  
    6262          if (availableJobs.Count() > 0) {
    6363            var job = availableJobs.First();
    64             actions.Add(new MessageContainer(MessageContainer.MessageType.CalculateJob, job.Id));
    65             AssignJob(slave, job);
     64            if (AssignJob(slave, job))
     65              actions.Add(new MessageContainer(MessageContainer.MessageType.CalculateJob, job.Id));
    6666          }
    6767        }
     
    7070    }
    7171
    72     private void AssignJob(Slave slave, Job job) {
     72    // returns true if assignment was successful
     73    private bool AssignJob(Slave slave, Job job) {
     74      // load job again and check if it is still available (this is an attempt to reduce the race condition which causes multiple heartbeats to get the same job assigned)
     75      if (dao.GetJob(job.Id).State != JobState.Waiting) return false;
     76
    7377      job = dao.UpdateJobState(job.Id, JobState.Transferring, slave.Id, null, null);
    74       dao.UpdateSlave(slave);
    7578
    7679      // from now on the job has some time to send the next heartbeat (ApplicationConstants.TransferringJobHeartbeatTimeout)
    7780      job.LastHeartbeat = DateTime.Now;
    7881      dao.UpdateJob(job);
     82      return true;
    7983    }
    8084
Note: See TracChangeset for help on using the changeset viewer.