Skip to content

fix: issue with interruptible commands on interrupt. - #5339

Merged
prmukherj merged 6 commits into
mainfrom
fix/iterate_on_interrupt
Aug 21, 2026
Merged

fix: issue with interruptible commands on interrupt.#5339
prmukherj merged 6 commits into
mainfrom
fix/iterate_on_interrupt

Conversation

@prmukherj

Copy link
Copy Markdown
Collaborator

Context

Calling session.settings.solution.run_calculation.interrupt() from within a SolverEvent.ITERATION_ENDED callback causes the concurrently-blocking run_calculation.iterate() gRPC call on the main thread to raise RuntimeError: () rather than returning normally — even though Fluent itself stops the solver cleanly and prints Done. Operation stopped.

The consequence is that any code following the iterate() call (writing case files, post-processing, etc.) is silently skipped. This makes event-driven convergence monitoring unreliable in practice.

Change Summary

  1. Pass is_interruptible from the solver to the settings root.
  2. Use that to check if any interruptible commands raise RuntimeError: (), and if so swallow the error.
  3. Added test with the case in the particular bug to check the behavior for all Fluent versions.

Rationale

Ideally Fluent should not raise an error in this case, but currently it is interrupting cleanly and raising an error with blank message unlike in other cases where the message strings are populated appropriately. Hence using that to handle this particular bug.

Impact

Users will not face the situation as described, and will be able to develop similar workflows seamlessly.

@github-actions github-actions Bot added the bug Issue, problem or error in PyFluent label Aug 21, 2026
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Comment thread src/ansys/fluent/core/solver/flobject.py
@seanpearsonuk

Copy link
Copy Markdown
Collaborator

@prmukherj Isn't this all done and ready?

@prmukherj
prmukherj marked this pull request as ready for review August 21, 2026 14:16
@prmukherj

Copy link
Copy Markdown
Collaborator Author

@prmukherj Isn't this all done and ready?

Ready now @seanpearsonuk

@prmukherj
prmukherj enabled auto-merge (squash) August 21, 2026 14:52
@prmukherj
prmukherj merged commit c3d4b88 into main Aug 21, 2026
46 of 54 checks passed
@prmukherj
prmukherj deleted the fix/iterate_on_interrupt branch August 21, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue, problem or error in PyFluent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: iterate() raises RuntimeError when stopped via interrupt() from a solver event callback

4 participants