You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rich appears to run into a deadlock when exiting from a Status or Live context. This appears to be analogous to #90. The analysis in that issue appears to apply here, as well: The refresh thread is joined under lock. This means that the refresh thread may be waiting for the lock, while the main thread holds the lock waiting for the refresh thread to exit.
Looks like the following change fixes the deadlock:
diff --git a/rich/live.py b/rich/live.py
index 0c01a36..db714c3 100644
--- a/rich/live.py+++ b/rich/live.py@@ -157,7 +157,11 @@ class Live(JupyterMixin, RenderHook):
try:
if self.auto_refresh and self._refresh_thread is not None:
self._refresh_thread.stop()
- self._refresh_thread.join()+ self._lock.release()+ try:+ self._refresh_thread.join()+ finally:+ self._lock.acquire()
self._refresh_thread = None
# allow it to fully render on the last even if overflow
self.vertical_overflow = "visible"
Describe the bug
rich appears to run into a deadlock when exiting from a
Status
orLive
context. This appears to be analogous to #90. The analysis in that issue appears to apply here, as well: The refresh thread is joined under lock. This means that the refresh thread may be waiting for the lock, while the main thread holds the lock waiting for the refresh thread to exit.To Reproduce
Output and traceback:
Platform
What platform (Win/Linux/Mac) are you running on? What terminal software are you using?
Diagnose
The text was updated successfully, but these errors were encountered: