Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4936 for branches


Ignore:
Timestamp:
11/25/10 15:24:35 (14 years ago)
Author:
cneumuel
Message:

#1260

  • seperated plugin folder on slaves into PluginCache and PluginTemp, so that the PluginManager does not load the plugins from the temporary folders (which caused rare concurrency issues)
Location:
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/Core.cs

    r4921 r4936  
    369369
    370370          Logger.Debug("Plugins fetched for job " + e.Result.Obj.Id);
    371           String pluginDir = Path.Combine(PluginCache.Instance.PluginRepositoryDir, e.Result.Obj.Id.ToString());
     371          String pluginDir = Path.Combine(PluginCache.Instance.PluginTempBaseDir, e.Result.Obj.Id.ToString());
    372372
    373373          AppDomain appDomain = HeuristicLab.PluginInfrastructure.Sandboxing.SandboxManager.CreateAndInitSandbox(pluginDir);
  • branches/HeuristicLab.Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/PluginCache.cs

    r4921 r4936  
    3737    private static PluginCache instance = null;
    3838
    39     public string PluginRepositoryDir { get; set; }
     39    public string PluginCacheDir { get; set; }
     40    public string PluginTempBaseDir { get; set; }
    4041
    4142    private List<PluginDescription> cachedPlugins = new List<PluginDescription>();
     
    5253
    5354    public PluginCache() {
    54       PluginRepositoryDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "plugins");
     55      PluginCacheDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "PluginCache");
     56      PluginTempBaseDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "PluginTemp");
    5557     
    56       this.pm = new PluginManager(PluginRepositoryDir);
     58      this.pm = new PluginManager(PluginCacheDir);
    5759      DoUpdateRun();
    5860    }
    5961
    6062    private void DoUpdateRun() {
    61       if (!Directory.Exists(PluginRepositoryDir)) {
    62         Directory.CreateDirectory(PluginRepositoryDir);
     63      if (!Directory.Exists(PluginCacheDir)) {
     64        Directory.CreateDirectory(PluginCacheDir);
    6365      }
    6466      pm.DiscoverAndCheckPlugins();
     
    6870    [MethodImpl(MethodImplOptions.Synchronized)]
    6971    public void CopyPluginsForJob(List<HivePluginInfoDto> requests, Guid jobId) {
    70       String targetDir = Path.Combine(PluginRepositoryDir, jobId.ToString());
     72      String targetDir = Path.Combine(PluginTempBaseDir, jobId.ToString());
    7173
    7274      if (Directory.Exists(targetDir)) {
     
    141143        foreach (HivePluginFile pf in updateablePlugin.PluginFiles) {
    142144          Logger.Debug(string.Format("writing {0}", Path.GetFileName(pf.Name)));
    143           File.WriteAllBytes(Path.Combine(PluginRepositoryDir, Path.GetFileName(pf.Name)), pf.BinaryFile);
     145          File.WriteAllBytes(Path.Combine(PluginCacheDir, Path.GetFileName(pf.Name)), pf.BinaryFile);
    144146        }
    145147      }
     
    150152      try {
    151153        Logger.Debug("unloading...");
    152         Directory.Delete(Path.Combine(PluginRepositoryDir, id.ToString()), true);
     154        Directory.Delete(Path.Combine(PluginTempBaseDir, id.ToString()), true);
    153155      }
    154156      catch (Exception ex) {
Note: See TracChangeset for help on using the changeset viewer.