Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix: HDFStore Resource Leak in DiskDatasetCache#2202

Open
Sagar-py wants to merge 1 commit intomicrosoft:mainmicrosoft/qlib:mainfrom
Sagar-py:fix/hdfstore-resource-leakSagar-py/qlib:fix/hdfstore-resource-leakCopy head branch name to clipboard
Open

fix: HDFStore Resource Leak in DiskDatasetCache#2202
Sagar-py wants to merge 1 commit intomicrosoft:mainmicrosoft/qlib:mainfrom
Sagar-py:fix/hdfstore-resource-leakSagar-py/qlib:fix/hdfstore-resource-leakCopy head branch name to clipboard

Conversation

@Sagar-py
Copy link
Copy Markdown

@Sagar-py Sagar-py commented May 5, 2026

Description

Replace manual pd.HDFStore open/close with a context manager in DiskDatasetCache.update() (qlib/data/cache.py)

Motivation and Context

The previous pattern relied on an explicit store.close() call that was never reached if any intermediate operation raised an exception. This leaked file descriptors and could leave the cache file in a partially-written corrupted state - making it all subsequent reads from that cache fail until the file was manually removed.

How Has This Been Tested?

  • Pass the test by running: pytest qlib/tests/test_all_pipeline.py under upper directory of qlib.
  • If you are adding a new feature, test on your own test scripts.

Types of changes

  • Fix bugs
  • Add new feature
  • Update documentation

@Sagar-py
Copy link
Copy Markdown
Author

Sagar-py commented May 5, 2026

@microsoft-github-policy-service agree

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.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.