Skip to content

Finalizers of finalizers no longer execute when upstream task fails #21346

@big-guy

Description

@big-guy

Before Gradle 7.5, finalizers of finalizers always ran.

Since Gradle 7.5, finalizers of finalizers only run when the upstream dependency is successful.

Expected Behavior

A finalizer should always run.

Current Behavior

A finalizer sometimes does not run.

Context

This build reproduces the problem:

task A {
    doLast {
        if (project.hasProperty("fail")) {
            throw new GradleException("boom")
        }
    }
    finalizedBy "f1"
}
task f1 {
    finalizedBy "f2"
    doLast {
        println "f1"
    }
}
task f2 {
    doLast {
        println "f2"
    }
}

Steps to Reproduce

With 7.4:

  • gradle A executes A, f1 and f2
  • gradle A -Pfail executes A, f1 and f2

With 7.5:

  • gradle A executes A, f1 and f2
  • gradle A -Pfail executes A and f1, but not f2

Metadata

Metadata

Assignees

Labels

a:buga:regressionThis used to workin:schedulerexecution plan, task graph, work lease, project lock

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions