Skip to content

"cannot join current thread" error printed to console for meshing session which is not closed #4700

@millerj97

Description

@millerj97

🔍 Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

🐞 Description of the bug

Calling a function multiple times which launches fluent meshing session such as below;

import ansys.fluent.core as pyfluent

def run_session():
    new_session =  pyfluent.launch_fluent(mode='meshing')
    print(new_session)
    return

run_session()
run_session()

The below exception is printed to the console if the sessions are not explicitly closed. Based on the message the exception has been handled but is still printed?;



Exception ignored in: <finalize object at ; dead>
Traceback (most recent call last):
  File "/usr/lib/python3.10/weakref.py", line 591, in __call__
    return info.func(*info.args, **(info.kwargs or {}))
  File "/.env/lib/python3.10/site-packages/ansys/fluent/core/fluent_connection.py", line 928, in _exit
    cb()
  File "/.env/lib/python3.10/site-packages/ansys/fluent/core/streaming_services/streaming.py", line 115, in stop
    self._stream_thread.join(timeout=5)
  File "/usr/lib/python3.10/threading.py", line 1093, in join
    raise RuntimeError("cannot join current thread")
RuntimeError: cannot join current thread

I have only been able to reproduce this error if the sessions are launched with the same name inside the function, and only for meshing mode

📝 Steps to reproduce

run the below in a script;

import ansys.fluent.core as pyfluent

def run_session():
    new_session =  pyfluent.launch_fluent(mode='meshing')
    print(new_session)
    # new_session.exit()
    return

run_session()
run_session()


repeat with mode="solver" and see no error
uncomment exit() and see no error

💻 Which operating system are you using?

Linux

📀 Which ANSYS version are you using?

No response

🐍 Which Python version are you using?

3.10

📦 Installed packages

ansys-api-fluent==0.3.36
ansys-api-platform-instancemanagement==1.1.3
ansys-api-tools-filetransfer==0.1.2
ansys-fluent-core==0.37.0
ansys-platform-instancemanagement==1.1.2
ansys-tools-common==0.3.1
ansys-tools-filetransfer==0.2.0
ansys-tools-local-product-launcher==0.2.0
ansys-units==0.9.1
appdirs==1.4.4
certifi==2025.11.12
charset-normalizer==3.4.4
click==8.3.1
defusedxml==0.7.1
Deprecated==1.3.1
docker==7.1.0
googleapis-common-protos==1.72.0
grpcio==1.76.0
grpcio-health-checking==1.62.3
grpcio-status==1.62.3
idna==3.11
importlib_metadata==8.7.0
joblib==1.5.2
nltk==3.9.2
numpy==2.2.6
pandas==2.3.3
platformdirs==4.5.1
protobuf==4.25.8
pyansys-tools-report==0.9.0
python-dateutil==2.9.0.post0
pytz==2025.2
PyYAML==6.0.3
regex==2025.11.3
requests==2.32.5
scooby==0.11.0
six==1.17.0
tqdm==4.67.1
typing_extensions==4.15.0
tzdata==2025.2
urllib3==2.6.0
wrapt==2.0.1
zipp==3.23.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue, problem or error in PyFluent

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions