Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6101 for branches


Ignore:
Timestamp:
05/02/11 19:07:24 (14 years ago)
Author:
ascheibe
Message:

#1233

  • don't lock engines for so long in StartJobInAppDomain
  • move SlaveCommListener to ConsoleClient
  • delete orphaned job folders at startup
Location:
branches/HeuristicLab.Hive-3.4/sources
Files:
1 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.ConsoleClient-3.4/HeuristicLab.Clients.Hive.Slave.ConsoleClient-3.4.csproj

    r5721 r6101  
    5858    <Compile Include="Program.cs" />
    5959    <Compile Include="Properties\AssemblyInfo.cs" />
     60    <Compile Include="SlaveCommListener.cs" />
    6061  </ItemGroup>
    6162  <ItemGroup>
    62     <ProjectReference Include="..\HeuristicLab.Clients.Hive.Slave.Tests\HeuristicLab.Clients.Hive.Slave.Tests-3.4.csproj">
    63       <Project>{C4CBD11E-1B83-464A-B0AD-0DC0FF7E57AA}</Project>
    64       <Name>HeuristicLab.Clients.Hive.Slave.Tests-3.4</Name>
    65     </ProjectReference>
    6663    <ProjectReference Include="..\HeuristicLab.Clients.Hive.Slave\3.4\HeuristicLab.Clients.Hive.Slave-3.4.csproj">
    6764      <Project>{989FE92B-484E-41EE-87E2-6A24AF0381D8}</Project>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.ConsoleClient-3.4/Program.cs

    r6039 r6101  
    2222using System;
    2323using System.Threading;
    24 using HeuristicLab.Clients.Hive.SlaveCore.Tests;
     24
    2525
    2626
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/HeuristicLab.Clients.Hive.Slave.Tests-3.4.csproj

    r5852 r6101  
    6666  </PropertyGroup>
    6767  <ItemGroup>
    68     <Reference Include="ALGLIB-2.5.0">
    69       <HintPath>C:\Program Files\HeuristicLab 3.3\ALGLIB-2.5.0.dll</HintPath>
    70     </Reference>
    7168    <Reference Include="ALGLIB-3.1.0">
    7269      <HintPath>C:\Program Files\HeuristicLab 3.3\ALGLIB-3.1.0.dll</HintPath>
     
    7471    <Reference Include="Google.ProtocolBuffers-0.9.1">
    7572      <HintPath>C:\Program Files\HeuristicLab 3.3\Google.ProtocolBuffers-0.9.1.dll</HintPath>
    76     </Reference>
    77     <Reference Include="HeuristicLab.ALGLIB-2.5.0">
    78       <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.ALGLIB-2.5.0.dll</HintPath>
    7973    </Reference>
    8074    <Reference Include="HeuristicLab.ALGLIB-3.1.0">
     
    347341    <Compile Include="Properties\AssemblyInfo.cs" />
    348342    <Compile Include="Mocks\MockServiceLocator.cs" />
    349     <Compile Include="SlaveCommListener.cs" />
    350343    <Compile Include="SlaveTest.cs" />
    351344  </ItemGroup>
    352345  <ItemGroup>
     346    <ProjectReference Include="..\HeuristicLab.Clients.Hive.Slave.ConsoleClient-3.4\HeuristicLab.Clients.Hive.Slave.ConsoleClient-3.4.csproj">
     347      <Project>{464D70B8-2D91-485C-B622-22E4A4891C68}</Project>
     348      <Name>HeuristicLab.Clients.Hive.Slave.ConsoleClient-3.4</Name>
     349    </ProjectReference>
    353350    <ProjectReference Include="..\HeuristicLab.Clients.Hive.Slave\3.4\HeuristicLab.Clients.Hive.Slave-3.4.csproj">
    354351      <Project>{989FE92B-484E-41EE-87E2-6A24AF0381D8}</Project>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/SlaveTest.cs

    r6006 r6101  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Clients.Hive.SlaveCore.ConsoleClient;
    2526using Microsoft.VisualStudio.TestTools.UnitTesting;
    2627
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs

    r6100 r6101  
    7979        slaveComm = new ServiceHost(typeof(SlaveCommunicationService));
    8080        slaveComm.Open();
    81 
    8281        clientCom = SlaveClientCom.Instance.ClientCom;
     82
     83        // delete all left over job directories
     84        PluginCache.Instance.CleanPluginTemp();
    8385        clientCom.LogMessage("Hive Slave started");
    8486
     
    483485            AppDomain appDomain = HeuristicLab.PluginInfrastructure.Sandboxing.SandboxManager.CreateAndInitSandbox(myJob.Id.ToString(), pluginDir, Path.Combine(pluginDir, configFileName));
    484486            appDomain.UnhandledException += new UnhandledExceptionEventHandler(AppDomain_UnhandledException);
     487            Executor engine;
    485488            lock (engines) {
    486489              appDomains.Add(myJob.Id, appDomain);
    487490              clientCom.LogMessage("Creating AppDomain");
    488               Executor engine = (Executor)appDomain.CreateInstanceAndUnwrap(typeof(Executor).Assembly.GetName().Name, typeof(Executor).FullName);
     491              engine = (Executor)appDomain.CreateInstanceAndUnwrap(typeof(Executor).Assembly.GetName().Name, typeof(Executor).FullName);
    489492              clientCom.LogMessage("Created AppDomain");
    490493              engine.JobId = myJob.Id;
     
    492495              clientCom.LogMessage("Starting Engine for job " + myJob.Id);
    493496              engines.Add(myJob.Id, engine);
    494               engine.Start(jobData.Data);
    495497            }
    496 
     498            engine.Start(jobData.Data);
    497499          }
    498500          catch (Exception exception) {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/PluginCache.cs

    r6008 r6101  
    231231
    232232    /// <summary>
     233    /// Checks the PluginTemp directory for orphaned directories and deletes them.
     234    /// This should be only called if no jobs are currently running.
     235    /// </summary>   
     236    public void CleanPluginTemp() {
     237      if (Directory.Exists(PluginTempBaseDir)) {
     238        foreach (string dir in Directory.EnumerateDirectories(PluginTempBaseDir)) {
     239          try {
     240            SlaveClientCom.Instance.ClientCom.LogMessage("Deleting orphaned directory " + dir);
     241            Directory.Delete(dir, true);
     242          }
     243          catch (Exception ex) {
     244            SlaveClientCom.Instance.ClientCom.LogMessage("Error cleaning up PluginTemp directory " + dir + ": " + ex.ToString());
     245          }
     246        }
     247      }
     248    }
     249
     250    /// <summary>
    233251    /// checks the pluginCacheDirectory and deletes plugin folders which are not used anymore
    234     /// </summary>
    235     /// <param name="path"></param>
     252    /// </summary>   
    236253    private void CleanPluginCache() {
    237254      FileStream fs = null;
Note: See TracChangeset for help on using the changeset viewer.