Skip to content

Task Execution Behavior Change when Interrupted in Versions 3.13.0 and Later #1178

@MoellerMarcel

Description

@MoellerMarcel
  • Task version: v3.24.0 (h1:0DKsGTmqYbEaACffm9H2BOm8pTcuSnb5SRUl7TCilQ4=)
  • Operating System: Windows Server 2022 Version 21H2
  • Bash: GNU bash, version 5.2.12(1)-release (x86_64-pc-msys)

Description

In versions prior to 3.13.0, when running a task again after it was interrupted, the task would be executed again. This behavior was (rightfully) caused by the corresponding checksum file being deleted.

However, starting from version 3.13.0, a change was made to this behavior. If an interrupted task is run again, the task command will indicate that the task is up to date.

Minimal Example

Taskfile (Taskfile.yml)

version: '3'

tasks:
  default:
    cmds:
      - bash.exe hello_world.sh
    generates:
      - "test.txt"
    sources:
      - "hello_world.sh"

  clean:
    cmds:
      - rm -rf .task
      - rm -f test.txt

Bash file (hello_world.sh):

#!/bin/bash
echo "Hello " > test.txt
sleep 10
echo "World" >> test.txt

Prior to v3.13.0

When interrupting the first run of the default task during the sleep command (using CTRL + C), a second attempt would be executed again because the checksum file was deleted.

$ task --version
Task version: v3.12.1 (h1:SmYDqaRgt9NOm/ogPaMviwckYCqCjbGek9DKF//5A2g=)

$ task clean
task: [clean] rm -rf .task
task: [clean] rm -f test.txt

$ task
task: [default] bash.exe hello_world.sh
task: signal received: interrupt
task: Failed to run task "default": exit status 1

$ ls .task/checksum/

$ task
task: [default] bash.exe hello_world.sh

Starting from v3.13.0

After the interruption of the first run, the checksum file remains, and the second run results in the message "Task 'default' is up to date."

$ task --version
Task version: v3.13.0 (h1:H1LzM7Ac2Ixz26086sgN7xxueXHcjVwy7qt9BrboiTs=)

$ task clean
task: [clean] rm -rf .task
task: [clean] rm -f test.txt

$ task
task: [default] bash.exe hello_world.sh
task: Signal received: "interrupt"

$ ls .task/checksum/
default

$ task
task: Task "default" is up to date

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: fingerprintingChanges related to checksums and caching.

    Type

    No fields configured for bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions