Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(garbage): subtasks are kept until the parent task is in a final state #366

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

orandin
Copy link
Member

@orandin orandin commented Oct 10, 2022

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Bug fix

  • What is the current behavior? (You can also link to an open issue here)

The subtasks are deleted even if the parent task is not done.

Side effect: If the parent task hasn't been executed before the deletion of the subtask, the parent task is in an inconsistent state. It can't determine the subtask state and continue the execution.

  • What is the new behavior (if this is a feature change)?

The subtasks are kept until the parent task is in a final state.

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

No

  • Other information:

Config

utask-cfg

{
    "completed_task_expiration": "1m"
}

Scripts

scripts/sleep.sh

#!/bin/bash

/bin/sleep 60

Templates

Click here to show templates

name:             garbage-parent
description:      Test garbage (parent)

title_format:     Test garbage

allowed_resolver_usernames:   []
allow_all_resolver_usernames: true
auto_runnable: true
blocked:       false
hidden:        false

steps:
  createSubtask:
    description: "Create subtask"
    action:
      type: subtask
      configuration:
        template: garbage-subtask
  Waiting:
    dependencies:
      - createSubtask
    description: "Wait one minute"
    action:
      type: script
      configuration:
        file_path: sleep.sh
name:             garbage-subtask
description:      Test garbage (subtask)

title_format:     Test garbage (subtask)

allowed_resolver_usernames:   []
allow_all_resolver_usernames: true
auto_runnable: true
blocked:       false
hidden:        true

steps:
  Hello:
    description: "Display a message"
    action:
      type: echo
      configuration:
        output:
          foo: 'bar'

Copy link
Member

@rbeuque74 rbeuque74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly the modification on the SQL query, the subtask is deleted if it doesn't have the subtask tags, or if the parent task is in the DONE,CANCELLED,WONTFIX states.

In some weird case, if the parent task is getting deleted BEFORE the subtask, the subtask will never be deleted. That would be a case we need to support IMO

@rclsilver rclsilver added the 🚧 WIP 🚧 Work in progress label label Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚧 WIP 🚧 Work in progress label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants