Skip to content

Fix cannot release un-acquired lock in Blob logger#2457

Merged
natoverse merged 6 commits into
mainfrom
issue-2170
Jul 17, 2026
Merged

Fix cannot release un-acquired lock in Blob logger#2457
natoverse merged 6 commits into
mainfrom
issue-2170

Conversation

@gaudyb

@gaudyb gaudyb commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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

  • I have tested these changes locally.
  • I have reviewed the code changes.
  • I have updated the documentation (if necessary).
  • I have added appropriate unit tests (if applicable).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 calling self.__init__() during writes.
  • Persist base_dir on 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.

Comment thread packages/graphrag/graphrag/logger/blob_workflow_logger.py
gaudyb and others added 3 commits July 17, 2026 12:24
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@natoverse
natoverse merged commit f5af4d2 into main Jul 17, 2026
19 of 20 checks passed
@natoverse
natoverse deleted the issue-2170 branch July 17, 2026 20:27
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.

3 participants