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

Closing Network transport takes long time #152

Closed
rhpijnacker opened this issue Mar 13, 2024 · 1 comment · Fixed by #153
Closed

Closing Network transport takes long time #152

rhpijnacker opened this issue Mar 13, 2024 · 1 comment · Fixed by #153

Comments

@rhpijnacker
Copy link

After a recent Home Assistant update, I noticed that it takes a very long time to perform a reboot (minutes!).
Looking at the log file I noticed that the RFXtrx module is causing this:

2024-03-13 07:34:51.635 WARNING (MainThread) [homeassistant.util.executor] Thread[SyncWorker_29] is still running at shutdown: File "/usr/local/lib/python3.12/threading.py", line 1030, in _bootstrap
    self._bootstrap_inner()
  File "/usr/local/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.12/threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 92, in _worker
    work_item.run()
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/rfxtrx/__init__.py", line 283, in _shutdown_rfxtrx
    rfx_object.close_connection()
  File "/usr/local/lib/python3.12/site-packages/RFXtrx/__init__.py", line 1090, in close_connection
    self._thread.join()
  File "/usr/local/lib/python3.12/threading.py", line 1147, in join
    self._wait_for_tstate_lock()
  File "/usr/local/lib/python3.12/threading.py", line 1167, in _wait_for_tstate_lock
    if lock.acquire(block, timeout):
2024-03-13 07:34:52.634 WARNING (MainThread) [homeassistant.util.executor] Thread[SyncWorker_29] is still running at shutdown: File "/usr/local/lib/python3.12/threading.py", line 1030, in _bootstrap
    self._bootstrap_inner()
  File "/usr/local/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.12/threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 92, in _worker
    work_item.run()
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/rfxtrx/__init__.py", line 283, in _shutdown_rfxtrx
    rfx_object.close_connection()
  File "/usr/local/lib/python3.12/site-packages/RFXtrx/__init__.py", line 1090, in close_connection
    self._thread.join()
  File "/usr/local/lib/python3.12/threading.py", line 1147, in join
    self._wait_for_tstate_lock()
  File "/usr/local/lib/python3.12/threading.py", line 1167, in _wait_for_tstate_lock
    if lock.acquire(block, timeout):

This looks a lot like issue #146 that I previously posted (and fixed).
The rework done in #150 seems to have re-introduced this issue for me.

@rhpijnacker
Copy link
Author

FYI: I put back the call to

        self.sock.shutdown(socket.SHUT_RDWR)

inside the HA docker container and now it reboots quickly like expected.

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 a pull request may close this issue.

1 participant