Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7187


Ignore:
Timestamp:
12/14/11 01:09:54 (13 years ago)
Author:
ascheibe
Message:

#1672

  • increased times between life cycles on the server
  • some smaller performance improvements on the server
Location:
trunk/sources/HeuristicLab.Services.Hive/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Services.Hive/3.3/HiveService.cs

    r7045 r7187  
    559559      authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Slave);
    560560      // use a serializable transaction here to ensure not two threads execute this simultaniously (mutex-lock would not work since IIS may use multiple AppDomains)
     561      bool cleanup = false;
    561562      trans.UseTransaction(() => {
    562563        DateTime lastCleanup = dao.GetLastCleanup();
    563         if (force || DateTime.Now - lastCleanup > TimeSpan.FromSeconds(59)) {
     564        if (force || DateTime.Now - lastCleanup > TimeSpan.FromSeconds(140)) {
    564565          dao.SetLastCleanup(DateTime.Now);
    565           eventManager.Cleanup();
     566          cleanup = true;
    566567        }
    567568      }, true);
     569
     570      if (cleanup) {
     571        eventManager.Cleanup();
     572      }
    568573    }
    569574    #endregion
  • trunk/sources/HeuristicLab.Services.Hive/3.3/Manager/EventManager.cs

    r7178 r7187  
    4141      get { return LogFactory.GetLogger(this.GetType().Namespace); }
    4242    }
     43    private DataAccess.ITransactionManager trans {
     44      get { return ServiceLocator.Instance.TransactionManager; }
     45    }
    4346
    44     public void Cleanup() {
    45       SetTimeoutSlavesOffline();
    46       SetTimeoutTasksWaiting();
    47       FinishParentTasks();
    48       UpdateStatistics();
     47    public void Cleanup() {
     48      trans.UseTransaction(() => {
     49        SetTimeoutSlavesOffline();
     50        SetTimeoutTasksWaiting();
     51      }, true);
     52
     53      trans.UseTransaction(() => {
     54        FinishParentTasks();
     55        UpdateStatistics();
     56      }, false);
    4957    }
    5058
  • trunk/sources/HeuristicLab.Services.Hive/3.3/Manager/HeartbeatManager.cs

    r6983 r7187  
    4444      if (slave == null) {
    4545        actions.Add(new MessageContainer(MessageContainer.MessageType.SayHello));
    46       } else {
    47         Slave s = dao.GetSlave(heartbeat.SlaveId);
    48         if (s != null) {
    49           if (heartbeat.HbInterval != s.HbInterval) {
    50             actions.Add(new MessageContainer(MessageContainer.MessageType.NewHBInterval));
    51           }
     46      } else {       
     47        if (heartbeat.HbInterval != slave.HbInterval) {
     48          actions.Add(new MessageContainer(MessageContainer.MessageType.NewHBInterval));
    5249        }
    53 
     50       
    5451        // update slave data
    5552        slave.FreeCores = heartbeat.FreeCores;
Note: See TracChangeset for help on using the changeset viewer.