Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using KeyboardInterrupt (Ctrl+C) to end osl, the optiSLang process is killed, but the __refresh_listener_registration is still active causing OslCommunicationErrors #46

Closed
vymlatilp opened this issue Sep 30, 2022 · 1 comment · Fixed by #67
Labels
bug Something isn't working

Comments

@vymlatilp
Copy link
Collaborator

    @PanekOndrej Finally I observed that when using KeyboardInterrupt (Ctrl+C) to end osl, the optiSLang process is killed, but the `__refresh_listener_registration` is still active causing OslCommunicationErrors:

osl = Optislang(project_path = "/tmp/sc.opf")
^C
KeyboardInterrupt
Exception in thread Thread-1:
Traceback (most recent call last):
File "/homelocal/fahlberg/develop/sandbox/git/protos/optiSLang/dist/lib/python3.7/lib/python3.7/site-packages/ansys/optislang/core/tcp_osl_server.py", line 1600, in _send_command
self.__host, self.__port, timeout=_get_current_timeout(self.__timeout, start_time)
File "/homelocal/fahlberg/develop/sandbox/git/protos/optiSLang/dist/lib/python3.7/lib/python3.7/site-packages/ansys/optislang/core/tcp_osl_server.py", line 182, in connect
f"Connection could not be established to host {host} and port {port}."
ConnectionRefusedError: Connection could not be established to host 127.0.0.1 and port 5310.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/homelocal/fahlberg/develop/sandbox/git/protos/optiSLang/dist/lib/python3.7/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/homelocal/fahlberg/develop/sandbox/git/protos/optiSLang/dist/lib/python3.7/lib/python3.7/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/homelocal/fahlberg/develop/sandbox/git/protos/optiSLang/dist/lib/python3.7/lib/python3.7/site-packages/ansys/optislang/core/tcp_osl_server.py", line 1560, in __refresh_listener_registration
uid=self.__listener_uid, password=self.__password
File "/homelocal/fahlberg/develop/sandbox/git/protos/optiSLang/dist/lib/python3.7/lib/python3.7/site-packages/ansys/optislang/core/tcp_osl_server.py", line 1612, in _send_command
) from ex
ansys.optislang.core.errors.OslCommunicationError: An error occurred while communicating with the optiSLang server.

Originally posted by @rfahlberg in #39 (comment)

@PanekOndrej PanekOndrej added the bug Something isn't working label Sep 30, 2022
@PanekOndrej
Copy link
Collaborator

PanekOndrej commented Oct 24, 2022

  • signal handler was added
  • atexit.register(dispose)
  • daemon threads
  • destructor removed from osl_process

@PanekOndrej PanekOndrej linked a pull request Nov 1, 2022 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants