task finally always emit

Showcases that the finally block will be always fired even there is no exception / error

Demo

source

Main task yaml file
    vars:
      global_aa: aa
    tasks:
    - name: task
      task:
      - func: shell
        vars:
          local_bb: bb
        dvars:
        - name: task_tt
          value: tt
          flags: [taskScope]
        name: step1
        desc: step 1
        do:
        - echo "opening file"
      desc: |
        without rescue, the execution will return a non-zero  return code in shell and also report the error
        with rescue, the program will return 0
      rescue: true
      finally:
      - func: shell
        vars:
          finally_cc: cc
        name: close_file
        desc: |
          ensure the opened file is closed
        do:
        - echo "close the file ....."
    
Main log file
    loading [Config]:  ./tests/functests/upconfig.yml
    Main config:
                 Version -> 1.0.0
                  RefDir -> ./tests/functests
                 WorkDir -> cwd
              AbsWorkDir -> /up_project/up
                TaskFile -> c0189
                 Verbose -> vvv
              ModuleName -> self
               ShellType -> /bin/sh
           MaxCallLayers -> 8
                 Timeout -> 3600000
     MaxModuelCallLayers -> 256
               EntryTask -> task
      ModRepoUsernameRef -> 
      ModRepoPasswordRef -> 
    work dir: /up_project/up
    -exec task: task
    loading [Task]:  ./tests/functests/c0189
    module: [self], instance id: [dev], exec profile: []
    profile -  envVars:
    
    (*core.Cache)({
    })
    
    Task1: [task ==> task: without rescue, the execution will return a non-zero  return code in shell and also report the error
    with rescue, the program will return 0
     ]
    -Step1: [step1: step 1 ]
    self: final context exec vars:
    
    (*core.Cache)({
      "local_bb": "bb",
      "task_tt": "tt",
      "global_aa": "aa",
      "up_runtime_task_layer_number": 0
    })
    
    cmd( 1):
    echo "opening file"
    
    -
    opening file
    
    -
     .. ok
    . ok
    task Finally:
    Step1: [
    close_fileensure the opened file is closed
    ]
    self: final context exec vars:
    
    (*core.Cache)({
      "finally_cc": "cc",
      "global_aa": "aa",
      "up_runtime_task_layer_number": 0,
      "task_tt": "tt"
    })
    
    cmd( 1):
    echo "close the file ....."
    
    -
    close the file .....
    
    -
     .. ok
    . ok
    
Logs with different verbose level
Raw logs with different verbose level

Other references: