Skip to content

[🐛 BUG] Deleting a scenario with a running submission blocks all other submissions #2877

Description

@arcanaxion

🔍 What went wrong?

Example code:

import time

import taipy as tp
from taipy import Config, Job, Scenario, Task
from taipy.gui import Gui


def square(x: int) -> int:
    time.sleep(2)
    return x**2


def cube(y: int) -> int:
    return y**3


x_cfg = Config.configure_data_node(id="x", default_data=5)
y_cfg = Config.configure_data_node(id="y")
z_cfg = Config.configure_data_node(id="z")
square_task_cfg = Config.configure_task(id="square", function=square, input=x_cfg, output=y_cfg)
cube_task_cfg = Config.configure_task(id="cube", function=cube, input=y_cfg, output=z_cfg)
scenario_cfg = Config.configure_scenario(id="scenario", task_configs=[square_task_cfg, cube_task_cfg])


if __name__ == "__main__":
    tp.Config.configure_job_executions(mode="standalone", max_nb_of_workers=1)
    tp.Orchestrator().run()

    scenario1 = tp.create_scenario(scenario_cfg, name="Scenario 1")
    scenario1.submit()
    scenario2 = tp.create_scenario(scenario_cfg, name="Scenario 2")
    scenario2.submit()
    tp.delete(scenario1.id)

    time.sleep(5)  # Let whatever is going to happen happen
    print(tp.get_submissions()[0].__dict__)  # _submission_status': <SubmissionStatus.BLOCKED: 2>, '_is_completed': True
    print(scenario2.data_nodes["z"].read())  # Data node DATANODE_z_1404e5cf-fee3-4f95-8096-a8efb3df6f2f from config z is being read but has never been written.
    breakpoint()

Observe following output in my breakpoint:

-> breakpoint()
(Pdb) tp.create_scenario(scenario_cfg).submit()
<taipy.core.submission.submission.Submission object at 0x721a077218e0>
(Pdb) [2026-05-22 17:39:40.910][Taipy][INFO] job JOB_square_a5d9a43d-3513-4de1-8be9-462f5beea24e is completed.
[2026-05-22 17:39:40.917][Taipy][ERROR] Job not found: JOB_cube_1a53dde4-bb74-4948-a062-0b9b3239d392
[2026-05-22 17:39:40.917][Taipy][ERROR] DataNode not found: DATANODE_y_dab50d8c-1957-44d8-af41-291356ed27d2
exception calling callback for <Future at 0x721a0acbe3c0 state=finished returned list>
Traceback (most recent call last):
  File "/home/.local/share/uv/python/cpython-3.12.12-linux-x86_64-gnu/lib/python3.12/concurrent/futures/_base.py", line 340, in _invoke_callbacks
    callback(self)
  File "/home/.venv/lib/python3.12/site-packages/taipy/enterprise/core/_orchestrator/_dispatcher/_standalone_job_dispatcher.py", line 54, in _update_authorized_job_status_from_future
    super()._update_job_status_from_future(job, ft)
  File "/home/.venv/lib/python3.12/site-packages/taipy/core/_orchestrator/_dispatcher/_standalone_job_dispatcher.py", line 70, in _update_job_status_from_future
    self._update_job_status(job, ft.result())
  File "/home/.venv/lib/python3.12/site-packages/taipy/core/_orchestrator/_dispatcher/_job_dispatcher.py", line 165, in _update_job_status
    job.completed()
  File "/home/.venv/lib/python3.12/site-packages/taipy/core/job/job.py", line 38, in __run_callbacks
    fct(job)
  File "/home/.venv/lib/python3.12/site-packages/taipy/core/_orchestrator/_orchestrator.py", line 249, in _on_status_change
    cls.__unblock_jobs()
  File "/home/.venv/lib/python3.12/site-packages/taipy/core/_orchestrator/_orchestrator.py", line 258, in __unblock_jobs
    if not cls._is_blocked(job):
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/.venv/lib/python3.12/site-packages/taipy/core/_orchestrator/_orchestrator.py", line 237, in _is_blocked
    return any(not data_manager._get(dn.id).is_ready_for_reading for dn in input_data_nodes)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/.venv/lib/python3.12/site-packages/taipy/core/_orchestrator/_orchestrator.py", line 237, in <genexpr>
    return any(not data_manager._get(dn.id).is_ready_for_reading for dn in input_data_nodes)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'is_ready_for_reading'

📦 Taipy Version

develop

📋 Additional Context (Optional)

📜 Code of Conduct

  • I have checked the existing issues to avoid duplicates.
  • I am willing to work on this issue (optional)

✅ Acceptance Criteria

  • A reproducible unit test is added.
  • Code coverage is at least 90%.
  • The bug reporter validated the fix.
  • Relevant documentation updates or an issue created in

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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