Fix cannot release un-acquired lock in Blob logger#2457
Merged
Conversation
added 2 commits
July 17, 2026 10:57
This was referenced Jul 17, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a crash in BlobWorkflowLogger caused by reinitializing the logging.Handler inside _write_log (leading to “cannot release un-acquired lock”), and also ensures base_dir is stored so blob rotation can reliably build blob names. It adds unit tests to validate initialization, rotation behavior, and log type mapping.
Changes:
- Refactor blob rotation into
_rotate_blob()and stop callingself.__init__()during writes. - Persist
base_diron the logger instance and use it when composing blob paths. - Add unit tests covering initialization, rotation, append behavior, and level-to-type mapping.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/graphrag/graphrag/logger/blob_workflow_logger.py | Fixes lock crash by avoiding re-init during rotation; stores base_dir; centralizes blob creation in _rotate_blob(). |
| tests/unit/logger/test_blob_workflow_logger.py | Adds tests validating blob initialization, rotation behavior (including lock stability), and log writing/type mapping. |
| tests/unit/logger/init.py | Adds package marker for the new test module. |
| .semversioner/next-release/patch-20260717165805703786.json | Records a patch-level release note for the fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
natoverse
approved these changes
Jul 17, 2026
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
Fixes a crash in BlobWorkflowLogger where base_dir was accepted in init but never stored, causing _rotate_blob to fail on self._base_dir. Also cleans up indentation in _write_log and adds unit test coverage for the logger.
Checklist