FIX make file output safe across event loops - #2664
Merged
Roman Lutz (romanlutz) merged 3 commits intoSep 15, 2026
Merged
Roman Lutz (romanlutz) merged 3 commits into
Roman Lutz (romanlutz) merged 3 commits into
Conversation
Serialize file writes inside worker threads so one sink can be reused across event loops. Add deterministic contended-write regression coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 21bf73f6-4b26-4f5f-bb22-01fa72e49186
Remove the unreferenced Microsoft SVG added with the landing-page ecosystem artwork. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 21bf73f6-4b26-4f5f-bb22-01fa72e49186
hannahwestra25
approved these changes
Sep 15, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 21bf73f6-4b26-4f5f-bb22-01fa72e49186
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.
Description
FileSinkcurrently uses anasyncio.Lock, which becomes bound to the first event loop that contends on it. Reusing the same sink from a laterasyncio.run(...)call can therefore raise a cross-event-loopRuntimeError.This change moves serialization into the worker thread with
threading.Lock, so the event loop remains non-blocking while one sink can safely serialize file writes across event loops. It also removes an unreferenced ecosystem SVG discovered during the audit and updates the output contributor guidance to match the locking design.Tests and Documentation
ty check pyritpassed with no diagnostics.uv lock --check, compileall, documentation TOC/orphan validation, and pre-commit hooks passed.