Skip to content

Flux: Handle finished future objects#835

Merged
jan-janssen merged 2 commits intomainfrom
surpress
Oct 4, 2025
Merged

Flux: Handle finished future objects#835
jan-janssen merged 2 commits intomainfrom
surpress

Conversation

@jan-janssen
Copy link
Member

@jan-janssen jan-janssen commented Oct 4, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Improved shutdown behavior for interactive task execution, avoiding spurious errors when cancelling jobs and waiting for completion.
    • Suppressed non-critical exceptions during final result retrieval, reducing false failure reports and log noise.
    • Enhances stability and reliability during shutdown sequences without altering normal polling behavior or runtime performance.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 4, 2025

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

💤 Files selected but had no reviewable changes (1)
  • notebooks/5-1-gpaw.ipynb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The shutdown logic in executorlib/task_scheduler/interactive/spawner_flux.py now wraps the final future.result() call in a contextlib.suppress for flux.job.event.JobException after cancellation, changing error handling to ignore that exception. Imports updated to include contextlib. No public APIs changed.

Changes

Cohort / File(s) Summary
Shutdown exception handling
executorlib/task_scheduler/interactive/spawner_flux.py
Import contextlib; in shutdown, wrap self._future.result() with contextlib.suppress(flux.job.event.JobException) after cancellation, leaving polling behavior unchanged and avoiding raised JobException during final result retrieval.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant TS as TaskScheduler
  participant FF as Flux Future

  TS->>FF: cancel()
  Note right of FF: Future is cancelled
  TS->>FF: wait/poll until done
  alt result retrieval
    TS->>FF: result()
    FF-->>TS: JobException
    Note over TS: Exception suppressed (no propagation)
  else no exception
    FF-->>TS: result value
  end
  TS-->>TS: proceed with shutdown
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A rabbit taps the shutdown key,
Hush, little errors—let them be.
We cancel, wait, and softly tread,
Suppress the grumps; move on instead.
Flux winds down, future’s calm and still—
Hippity-hop, another tidy build! 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly indicates that this PR addresses handling of finished Flux future objects, which matches the core change of suppressing JobException when retrieving results. It is concise and clearly conveys the focus on improving Flux task shutdown behavior without extraneous details. Therefore it accurately reflects the main modification in the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
executorlib/task_scheduler/interactive/spawner_flux.py (1)

151-152: Restrict or log suppressed JobException
Suppressing all flux.job.event.JobException in spawner_flux.py (lines 151–152) hides legitimate failures. Either guard on self._future.cancelled() before calling result(), or catch and log the exception (e.g., at debug level) to surface unexpected errors.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 276ef56 and e727d58.

📒 Files selected for processing (1)
  • executorlib/task_scheduler/interactive/spawner_flux.py (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
executorlib/task_scheduler/interactive/spawner_flux.py (1)
executorlib/task_scheduler/file/shared.py (1)
  • result (24-38)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
  • GitHub Check: notebooks_integration
  • GitHub Check: unittest_openmpi (ubuntu-22.04-arm, 3.13)
  • GitHub Check: unittest_openmpi (ubuntu-latest, 3.11)
  • GitHub Check: unittest_mpich (ubuntu-latest, 3.13)
  • GitHub Check: unittest_openmpi (ubuntu-latest, 3.12)
  • GitHub Check: unittest_openmpi (ubuntu-latest, 3.13)
  • GitHub Check: unittest_mpich (macos-latest, 3.13)
  • GitHub Check: unittest_mpich (ubuntu-latest, 3.11)
  • GitHub Check: unittest_slurm_mpich
  • GitHub Check: unittest_mpich (ubuntu-latest, 3.12)
  • GitHub Check: unittest_flux_openmpi
  • GitHub Check: unittest_mpich (ubuntu-24.04-arm, 3.13)
  • GitHub Check: unittest_mpich (ubuntu-22.04-arm, 3.13)
  • GitHub Check: unittest_flux_mpich
  • GitHub Check: benchmark (ubuntu-latest, 3.13, .ci_support/environment-openmpi.yml)
  • GitHub Check: notebooks
  • GitHub Check: benchmark (ubuntu-latest, 3.13, .ci_support/environment-mpich.yml)
  • GitHub Check: unittest_old
  • GitHub Check: unittest_win
🔇 Additional comments (1)
executorlib/task_scheduler/interactive/spawner_flux.py (1)

1-1: LGTM!

The import is necessary for the contextlib.suppress() usage in the shutdown method.

@codecov
Copy link

codecov bot commented Oct 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.16%. Comparing base (276ef56) to head (76809eb).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #835   +/-   ##
=======================================
  Coverage   98.16%   98.16%           
=======================================
  Files          34       34           
  Lines        1686     1688    +2     
=======================================
+ Hits         1655     1657    +2     
  Misses         31       31           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@jan-janssen jan-janssen merged commit 4202b36 into main Oct 4, 2025
35 checks passed
@jan-janssen jan-janssen deleted the surpress branch October 4, 2025 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant