DESCFRIPTION:
With Python 3.14.4, the logtail 0.3.4 library throws a RuntimeError in flusher.py, method _is_parent_alive, when calling self.parent_thread.is_alive().
This happens because, starting from Python 3.14, calling is_alive() on an already terminated thread raises a RuntimeError, while in previous versions it simply returned False.
STACKTRACE:
File "logtail/flusher.py", line XX, in _is_parent_alive
return self.parent_thread.is_alive()
RuntimeError: cannot join current thread
TEMPORARY WORKAROUND:
I fixed it locally by handling the exception with a try/except block that returns False in case of RuntimeError (as already present in the source code, but it seems not to cover all cases).
STEP TO REPRODUCE ISSUE:
- Install logtail 0.3.4 on Python 3.14.4
- Send a log using LogtailHandler
- Terminate the process or wait for the thread to close
- The above exception occurs
SUGGESTION:
Update the thread management to be compatible with Python 3.14.x
DESCFRIPTION:
With Python 3.14.4, the logtail 0.3.4 library throws a RuntimeError in flusher.py, method _is_parent_alive, when calling self.parent_thread.is_alive().
This happens because, starting from Python 3.14, calling is_alive() on an already terminated thread raises a RuntimeError, while in previous versions it simply returned False.
STACKTRACE:
File "logtail/flusher.py", line XX, in _is_parent_alive
return self.parent_thread.is_alive()
RuntimeError: cannot join current thread
TEMPORARY WORKAROUND:
I fixed it locally by handling the exception with a try/except block that returns False in case of RuntimeError (as already present in the source code, but it seems not to cover all cases).
STEP TO REPRODUCE ISSUE:
SUGGESTION:
Update the thread management to be compatible with Python 3.14.x