#217 Fails in <for parallel="true" keepgoing="false">

open
nobody
logic (23)
5
2015-12-09
2007-10-26
Anonymous
No

<for parallel="true" keepgoing="false"> does not stop execution if one of the threads fails.
<parallel> implementation does not use failonany="true" in this case.

Discussion

  • Christopher Heiny

    Logged In: YES
    user_id=117164
    Originator: NO

    I've got a patch against trunk for this, but don't see a button for attaching the patch file to the bug. It's trivial, so here it is:

    Index: src/main/java/net/sf/antcontrib/logic/ForTask.java

    --- src/main/java/net/sf/antcontrib/logic/ForTask.java (revision 146)
    +++ src/main/java/net/sf/antcontrib/logic/ForTask.java (working copy)
    @@ -212,6 +212,7 @@
    public void execute() {
    if (parallel) {
    parallelTasks = (Parallel) getProject().createTask("parallel");
    + parallelTasks.setFailOnAny(keepgoing);
    if (threadCount != null) {
    parallelTasks.setThreadCount(threadCount.intValue());
    }

     
  • Nobody/Anonymous

    Logged In: NO

    clheiny,
    There is an error in the code:

    parallel failonany should use reverted ForTask keepgoing value, i.e. if keepgoing is false failonany should be true
    Thanks. Andrey.

     
  • Christopher Heiny

    Logged In: YES
    user_id=117164
    Originator: NO

    Hmmmm. I won't be able to look at this until next week, but my guess now is that it should be easy to remedy.

     
  • Mick Reilly

    Mick Reilly - 2015-12-09

    I have the same issue with this and yes keepgoing needs to be inverted.
    I have fixed locally but dislike branching, can we get a fix?

    public void execute() {
        if (parallel) {
            parallelTasks = (Parallel) getProject().createTask("parallel");
            parallelTasks.setFailOnAny(!(keepgoing));
            if (threadCount != null) {
                parallelTasks.setThreadCount(threadCount.intValue());
            }
        }
    
     

Log in to post a comment.