| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Starting with Python 3.14, calling `Thread.is_alive()` on an already-terminated thread raises `RuntimeError` instead of returning `False`. The flush worker checks `self.parent_thread.is_alive()` to detect parent-thread shutdown, so on Python 3.14.x this surfaces as an uncaught `RuntimeError` during teardown. Wrap the check in a `_is_parent_alive()` helper that treats a `RuntimeError` as "no longer alive", and add regression tests. Fixes T-17985. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Python 3.7-3.9 are end-of-life, and the older matrix was failing. Bump the CI matrix to 3.10-3.14 on ubuntu-24.04 and add a workflow_dispatch trigger so the suite can be run on demand. Keep the out-of-CI support declarations in sync: update the tox envlist and gh-actions mapping, refresh the setup.py Python classifiers, and add `python_requires='>=3.10'` to make the dropped EOL versions explicit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
With the minimum supported version now Python 3.10, the `version_info` early-return in test_frame and the `skipIf(sys.version_info < (3, 8))` guard in test_flusher are always false/never-skip. Remove them and the now-unused `sys` / `version_info` imports. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
datetime.utcfromtimestamp() is deprecated for removal. Use the timezone-aware datetime.fromtimestamp(ts, timezone.utc), which produces the identical UTC-aware value the assertion compares against. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
'3.x' resolves to the newest released stable Python 3, so future minor versions are exercised as soon as they ship (today it tracks 3.14 alongside the pinned entry). Set fail-fast: false so each version's result is reported independently. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Update user-facing product references: example project comments and log messages, the example README prose, the flusher endpoint comment, and the setup.py package description. Code identifiers (LogtailHandler, LogtailContext, the logtail package), repo URLs, the license copyright, and the "Logtail is now part of Better Stack" announcement are left as-is. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Release v0.4.0: Python 3.14 compatibility fix plus the drop of EOL Python 3.7-3.9 (backwards-incompatible support change -> minor bump). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Thank you!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Problem
With Python 3.14.x, logtail 0.3.4 raises an uncaught RuntimeError from FlushWorker during teardown:
File "logtail/flusher.py", in step shutdown = not self.parent_thread.is_alive() RuntimeError: cannot join current threadStarting with Python 3.14, calling Thread.is_alive() on an already-terminated thread raises a RuntimeError instead of simply returning False as it did in earlier versions. The flush worker relies on self.parent_thread.is_alive() to detect that the parent thread has exited so it can flush remaining events and shut down, so on 3.14.x this surfaces as an exception during interpreter/thread teardown.
Fix
Wrap the check in a small _is_parent_alive() helper that catches RuntimeError and treats it as "parent no longer alive" (which is the correct interpretation — the exception only occurs once the thread has terminated). Both call sites in step() now go through the helper.
Tests
Added two regression tests in tests/test_flusher.py:
Verified locally on Python 3.14.4 (the version from the report): tests/test_flusher.py passes (9 tests).
Also manually verified end-to-end on Python 3.14.4: the example project runs clean through teardown (no RuntimeError) and all six log levels are delivered to a live source (HTTP 202, confirmed in the dashboard including the exception traceback).
CI & supported versions
The old CI matrix (Python 3.7–3.11 on ubuntu-22.04) was failing on the EOL interpreters. This PR modernizes it:
Housekeeping
Release
Important
This PR is the v0.4.0 release. The version has been bumped to 0.4.0 in both setup.py and logtail/__init__.py. It's a minor bump (not a 0.3.x patch) because dropping Python 3.7–3.9 support is a backwards-incompatible change. Tag v0.4.0 after merge to publish.
Fixes #38.
🤖 Generated with Claude Code