Skip to content

⚗️ 🐛 fix(director-v2): yield event loop during compute_pipeline_details node-hash loop - #9469

Draft
giancarloromeo wants to merge 4 commits into
ITISFoundation:masterfrom
giancarloromeo:fix/director-v2-event-loop-starvation-pipeline-details
Draft

⚗️ 🐛 fix(director-v2): yield event loop during compute_pipeline_details node-hash loop#9469
giancarloromeo wants to merge 4 commits into
ITISFoundation:masterfrom
giancarloromeo:fix/director-v2-event-loop-starvation-pipeline-details

Conversation

@giancarloromeo

@giancarloromeo giancarloromeo commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

What do these changes do?

This pull request introduces a minor improvement to the computational nodes state-setting logic in dags.py. The main change is the addition of an await asyncio.sleep(0) call inside the loop that processes computational nodes, which helps yield control to the event loop and can improve responsiveness in async environments.

Related issue/s

How to test

Dev-ops

  • No changes.

@giancarloromeo giancarloromeo added this to the Toynbee Tiles milestone Jul 21, 2026
@giancarloromeo giancarloromeo self-assigned this Jul 21, 2026
@giancarloromeo giancarloromeo added the t:maintenance Maintenance work; used to filter tasks for end-of-sprint reporting in Review (Agreed July 3, Retro) label Jul 21, 2026
@github-actions github-actions Bot added the a:director-v2 issue related with the director-v2 service label Jul 21, 2026
@giancarloromeo
giancarloromeo requested a review from Copilot July 21, 2026 18:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to prevent event-loop starvation in director-v2 when computing pipeline details by explicitly yielding during the computational-node traversal used to compute node hashes/states.

Changes:

  • Added an asyncio import to support explicit yielding.
  • Inserted await asyncio.sleep(0) inside _set_computational_nodes_states() to yield to the event loop while iterating through computational nodes.

Comment thread services/director-v2/src/simcore_service_director_v2/utils/dags.py
Comment thread services/director-v2/src/simcore_service_director_v2/utils/dags.py
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.72%. Comparing base (e0c2a2e) to head (147c5c7).

❗ There is a different number of reports uploaded between BASE (e0c2a2e) and HEAD (147c5c7). Click for more details.

HEAD has 31 uploads less than BASE
Flag BASE (e0c2a2e) HEAD (147c5c7)
unittests 32 1
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #9469       +/-   ##
===========================================
- Coverage   87.60%   67.72%   -19.89%     
===========================================
  Files        2116      826     -1290     
  Lines       83403    37740    -45663     
  Branches     1553      202     -1351     
===========================================
- Hits        73069    25558    -47511     
- Misses       9913    12130     +2217     
+ Partials      421       52      -369     
Flag Coverage Δ
integrationtests 63.74% <100.00%> (+0.02%) ⬆️
unittests 85.40% <100.00%> (-1.13%) ⬇️
Components Coverage Δ
pkg_aws_library ∅ <ø> (∅)
pkg_celery_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library ∅ <ø> (∅)
pkg_notifications_library ∅ <ø> (∅)
pkg_postgres_database ∅ <ø> (∅)
pkg_service_integration ∅ <ø> (∅)
pkg_service_library ∅ <ø> (∅)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 67.10% <ø> (-19.25%) ⬇️
agent ∅ <ø> (∅)
api_server ∅ <ø> (∅)
autoscaling ∅ <ø> (∅)
catalog ∅ <ø> (∅)
clusters_keeper ∅ <ø> (∅)
dask_sidecar ∅ <ø> (∅)
datcore_adapter ∅ <ø> (∅)
director ∅ <ø> (∅)
director_v2 91.55% <100.00%> (-0.03%) ⬇️
dynamic_scheduler ∅ <ø> (∅)
dynamic_sidecar 72.67% <ø> (-15.70%) ⬇️
efs_guardian ∅ <ø> (∅)
invitations ∅ <ø> (∅)
payments ∅ <ø> (∅)
resource_usage_tracker ∅ <ø> (∅)
storage ∅ <ø> (∅)
webclient ∅ <ø> (∅)
webserver 59.22% <ø> (-27.75%) ⬇️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e0c2a2e...147c5c7. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

… of github.com:giancarloromeo/osparc-simcore into fix/director-v2-event-loop-starvation-pipeline-details
@sonarqubecloud

Copy link
Copy Markdown

@giancarloromeo giancarloromeo changed the title 🐛 fix(director-v2): yield event loop during compute_pipeline_details node-hash loop ⚗️ 🐛 fix(director-v2): yield event loop during compute_pipeline_details node-hash loop Jul 21, 2026
@giancarloromeo giancarloromeo removed this from the Toynbee Tiles milestone Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a:director-v2 issue related with the director-v2 service t:maintenance Maintenance work; used to filter tasks for end-of-sprint reporting in Review (Agreed July 3, Retro)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants