Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/31/08 10:07:09 (17 years ago)
Author:
gkronber
Message:

fixed #218 (DistributedEngine silently ignores when grid-jobs are canceled (because of exceptions) on grid-clients) by adding a property that holds an error message to the ProcessingEngine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.DistributedEngine/DistributedEngine.cs

    r412 r413  
    127127              }
    128128            }
     129
     130            CompositeOperation canceledOperations = new CompositeOperation();
     131            canceledOperations.ExecuteInParallel = true;
    129132            // retrieve results and merge into scope-tree
    130133            foreach(AtomicOperation parOperation in compositeOperation.Operations) {
    131134              ProcessingEngine resultEngine = jobManager.EndExecuteOperation(parOperation);
    132135              if(resultEngine.Canceled) {
    133                 // When the engine was canceled because of a problem at the client we can try to execute the steps locally.
    134                 // If they also fail the (local) distributued-engine will be aborted and we will see an error-message.
    135                 // so just push the original parallel operation back on the stack to force local execution.
    136                 ExecutionStack.Push(parOperation);
     136                ThreadPool.QueueUserWorkItem(delegate(object state) { OnExceptionOccurred(new JobExecutionException(resultEngine.ErrorMessage)); });
     137                canceledOperations.AddOperation(parOperation);
    137138              } else {
    138139                // if everything went fine we can merge the results into our local scope-tree
    139140                MergeScope(parOperation.Scope, resultEngine.InitialOperation.Scope);
    140141              }
     142            }
     143
     144            if(canceledOperations.Operations.Count > 0) {
     145              myExecutionStack.Push(canceledOperations);
     146              Abort();
    141147            }
    142148          } catch(Exception e) {
Note: See TracChangeset for help on using the changeset viewer.