Thread-safety / free-threaded fixes with tests#120
Open
greateggsgreg wants to merge 18 commits intopy4n6:mainfrom
Open
Thread-safety / free-threaded fixes with tests#120greateggsgreg wants to merge 18 commits intopy4n6:mainfrom
greateggsgreg wants to merge 18 commits intopy4n6:mainfrom
Conversation
Contributor
Author
|
Looks like ubuntu repos are having connectivity issues. Run a rebuild on the same code and it should be fine. |
Member
|
per https://status.canonical.com/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recent commits declared the module free-thread-compatible (
Py_MOD_GIL_NOT_USED, PR #119) and rewrote pytsk3's own error storage to be thread-local (PR #118). This PR addresses other thread safety and security issues surfaced during testing.I introduced fine-grained locking (per-instance, not module-wide), so on free-threaded Python pytsk3 calls genuinely run in parallel. Stress workload: 32 threads x 2000 iters x 6 reads = 384,000 ops on a shared
File:Tests include:
Img_Info/FS_Info/File/Volume_Inforeads, opens, and iterations.Directory.iternext,File.iternext,FS_Info.open*,File.as_directory,Volume_Info.iternext, borrowed-struct getters) survives parent drop + GC.Img_Info.closefrom one thread while readers are mid-flight produces a cleanIOError, never a crash.Directoryiterator consume exactlybaselineentries — no duplicates, no skips.gc.collect()produces identical entry counts.tsk_init'sstd::call_onceacross interpretersFinally - I added Python 3.14 free-threaded build targets for all platforms which also have tests run against them.
#121