Skip to content

fix: avoid private telemetry thread state - #180

Merged
b3by merged 1 commit into
meetecho:mainfrom
Mirochill:fix-179-telemetry-stop-python313
May 26, 2026
Merged

fix: avoid private telemetry thread state#180
b3by merged 1 commit into
meetecho:mainfrom
Mirochill:fix-179-telemetry-stop-python313

Conversation

@Mirochill

@Mirochill Mirochill commented May 21, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #179 by avoiding threading.Thread._is_stopped in TelemetryManager.stop(). Python 3.13+ no longer keeps this private implementation detail stable, so stopping telemetry can crash while checking the telemetry thread.

PR type
Select all the labels that apply to this PR.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test update
  • Build/CI configuration change
  • Other (please describe):

Key modifications and changes

  • Replaced the private _is_stopped check with the public Thread.is_alive() API.
  • Kept the change limited to the telemetry manager stop guard.

Affected components

Juturna core library: TelemetryManager.

Additional context

Validation:

  • git diff --check HEAD~1..HEAD
  • rg -n _is_stopped|is_alive|test_telemetry_stop_uses_public_thread_api juturna tests

Not run locally.

Comment thread tests/test_telemetry_manager.py Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would completely skip testing for this fix, especially considering the approach of mocking the entire Thread class. Could you please remove this file from the PR?

@Mirochill
Mirochill force-pushed the fix-179-telemetry-stop-python313 branch from 992bd3b to 543e90a Compare May 25, 2026 08:26
@Mirochill

Copy link
Copy Markdown
Contributor Author

Thanks, removed tests/test_telemetry_manager.py as requested. The PR now only changes TelemetryManager.stop() to use Thread.is_alive() instead of _is_stopped.

Validation:

  • git diff --check HEAD~1..HEAD
  • rg -n _is_stopped|is_alive|test_telemetry_stop_uses_public_thread_api juturna tests

Not run locally: test suite.

@b3by

b3by commented May 26, 2026

Copy link
Copy Markdown
Collaborator

Super, thank you!

@b3by
b3by marked this pull request as ready for review May 26, 2026 09:10
@b3by
b3by merged commit f28c76b into meetecho:main May 26, 2026
2 checks passed
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 this pull request may close these issues.

Telemetry manager crashes when stopping for python 3.13+

2 participants