Skip to content

Conversation

hpohekar
Copy link
Collaborator

@hpohekar hpohekar commented Oct 7, 2025

Description

This change fixes the exception type caught in the get_cortex_connection_properties method of fluent_connection.py. Previously the code only caught grpc._channel._InactiveRpcError — but with the introduction of the GrpcErrorInterceptor, failures may now propagate as RuntimeError.

With this PR:

  • The except _InactiveRpcError: branch is replaced by except RuntimeError: to correctly intercept failures from the new interceptor path.

  • Logging and fallback behavior remain unchanged.

A changelog fragment has been added (in doc/changelog.d/4518.fixed.md) to capture this change for release notes.

Motivation & Context

This change is necessary because errors previously not being caught would bubble up and potentially break upstream logic. Ensuring the correct exception is caught maintains expected behavior and stability, especially when using the newer gRPC error interceptor mechanism.

Impact

There should be no user‑facing API change; behavior when connections fail is preserved.

@hpohekar hpohekar linked an issue Oct 7, 2025 that may be closed by this pull request
2 tasks
@github-actions github-actions bot added the bug Issue, problem or error in PyFluent label Oct 7, 2025
@Copilot Copilot AI review requested due to automatic review settings October 8, 2025 02:59
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Updates the exception handling in get_cortex_connection_properties to align with the new GrpcErrorInterceptor behavior by catching RuntimeError instead of the previous gRPC-specific _InactiveRpcError, and adds a corresponding changelog entry.

  • Replace specific gRPC exception catch with RuntimeError
  • Remove now-unused local import of _InactiveRpcError
  • Add changelog fragment documenting the change

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/ansys/fluent/core/fluent_connection.py Broadened caught exception type from _InactiveRpcError to RuntimeError and removed the related local import.
doc/changelog.d/4518.fixed.md Added changelog fragment describing the exception handling update.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Copilot Copilot AI review requested due to automatic review settings October 8, 2025 10:55
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@hpohekar hpohekar merged commit 08a81c9 into main Oct 9, 2025
75 of 85 checks passed
@hpohekar hpohekar deleted the fix/update_exception_type branch October 9, 2025 06:59
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 located in ... launch fluent command
5 participants