Skip to content

database backend does not store children #8336

Description

@aaronst

The Task and TaskExtended models for the database backend do not include children. This means that when using any database backend, AsyncResult.children is always empty, even if a task does have children.

Activity

  1. open-collective-bot commented on Jun 22, 2023

    @open-collective-bot

    Hey @aaronst 👋,
    Thank you for opening an issue. We will get back to you as soon as we can.
    Also, check out our Open Collective and consider backing us - every little helps!

    We also offer priority support for our sponsors.
    If you require immediate assistance please consider sponsoring us.

  2. auvipy commented on Jun 23, 2023

    @auvipy
    Member

    I can't recall any reason behind it for not supporting it in database back end. would you mind doing some experiment to add that?

  3. aaronst commented on Jun 23, 2023

    @aaronst
    ContributorAuthor

    It looks like sqlalchemy.types.ARRAY is only supported with PostgreSQL, so it would have to be PickleType to be fully compatible.

  4. aaronst commented on Jun 23, 2023

    @aaronst
    ContributorAuthor

    @auvipy any extra help here would be much appreciated. Happy to keep working the PR, but want to make sure I'm on the right track.

  5. auvipy commented on Jun 24, 2023

    @auvipy
    Member

    OK sure

  6. added this to the 5.3.x milestone on Jun 27, 2023
  7. reopened this on Sep 2, 2023
  8. modified the milestones: 5.3.x, 5.4 on Sep 2, 2023
  9. modified the milestones: 5.4, 5.5 on Jun 25, 2024
  10. modified the milestones: 5.5.0, 5.7.0 on Jun 11, 2025
  11. modified the milestones: 5.7.0, 5.8.0 on Aug 31, 2026
  12. VimalN2005 commented on Sep 12, 2026

    @VimalN2005
    Contributor

    Hi @auvipy

    Could you please assign this issue to me? I would like to implement task children storage for the database result backend.

    Context & Plan:

    • I reviewed the previous attempt in store children with database backend #8338 and the revert in Revert "store children with database backend" #8475.
    • The Task and TaskExtended models currently do not store children, which causes AsyncResult.children to always return an empty list when using SQLAlchemy database backends.
    • To avoid breaking existing databases without migrations:
      1. Add a serialized children column (sa.LargeBinary) to TaskExtended (or Task with safe inspection).
      2. In _update_result and _get_task_meta_for, use Celery's configured serializer to serialize/deserialize child task metadata, gracefully falling back to None/empty list if the column or data is absent.
      3. Add test cases in t/unit/backends/test_database.py with canvas workflows (chains/groups) verifying AsyncResult.children.

    Could you please assign this to me? I will prepare the implementation and tests.

  13. auvipy commented on Sep 12, 2026

    @auvipy
    Member

    @VimalN2005 there is no need for assignment, please proceed with the PR and ping me there. thanks for your interest to fix this old problem. and I also saw your stamping related PR. thanks for that as well

  14. modified the milestones: 5.8.0, 5.7.0 on Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions