Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/18/11 17:57:14 (14 years ago)
Author:
cneumuel
Message:

#1260

  • robustified HiveEngine and HiveJobDownloader (handling of unobserved exceptions from tasks)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.ExperimentManager/3.3/HiveJobDownloader.cs

    r5181 r5329  
    5858      abort = false;
    5959      tasks = new List<Task<HiveJob>>();
     60      TaskScheduler.UnobservedTaskException += new EventHandler<UnobservedTaskExceptionEventArgs>(TaskScheduler_UnobservedTaskException);
    6061      foreach (Guid jobId in jobIds) {
    6162        tasks.Add(Task<SerializedJob>.Factory.StartNew(
     
    6465      }
    6566    }
     67
     68    private void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e) {
     69      e.SetObserved(); // evoid crash of process because task crashes. first exception found is handled in Results property
     70    }
     71
    6672    // use semaphore to ensure only few concurrenct connections and few SerializedJob objects in memory
    6773    private Semaphore downloadSemaphore = new Semaphore(2, 2);
Note: See TracChangeset for help on using the changeset viewer.