Skip to content

Potential race? condition for nested included taskfiles and vars handling #2595

@shadiramadan

Description

@shadiramadan

Description

See: https://github.com/shadiramadan/taskfile-issue

Multiple nested included Taskfiles might use vars from the wrong taskfile.

cd A

task B:D:greet
task B:D:greet
task B:D:greet
task B:D:greet

task B:C:greet
task B:C:greet
task B:C:greet
task B:C:greet

You should see D's greet occasionally printing C, and C's greet occasionally printing D. If you don't see it right away just keep running the commands, I've had 10+ streaks where it doesn't flip.

The issue does not occur in task B:C greet-no-var nor task B:D greet-no-var

The issue does occur in task B:C greet-unique (no task equivalent in D).

> $ tree
.
└── A
    ├── B
    │   ├── C
    │   │   └── Taskfile.yaml
    │   ├── D
    │   │   └── Taskfile.yaml
    │   └── Taskfile.yaml
    └── Taskfile.yaml

5 directories, 4 files

Version

3.46.3

Operating system

x86_64, Linux, Ubuntu 24.04.3 LTS

Experiments Enabled

No response

Example Taskfile

See: https://github.com/shadiramadan/taskfile-issue

(Multiple included Taskfiles)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions