[PR #422] fix(python): release userdata reference when prepare fails #426

Open
opened 2026-10-26 09:50:09 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/deepseek-ai/3FS/pull/422
Author: @030611
Created: 8/11/2026
Status: 🔄 Open

Base: main ← Head: fix/usrbio-prepare-error-ref


📝 Commits (1)

  • 5ebc19c fix(python): release userdata on prepare failure

📊 Changes

1 file changed (+13 additions, -10 deletions)

View changed files

📝 src/lib/py/usrbio_binding.cc (+13 -10)

📄 Description

The Python binding retains userdata manually so an asynchronous completion can return it later. When hf3fs_prep_io() returns a negative errno, no completion will be produced, but the retained reference was previously left behind.

Limit the GIL release to the native prepare call and release the manual reference on the error path after the GIL has been restored. The successful prepare/completion ownership path is unchanged.

This is separate from the userdata/iov reference cycle addressed by #421.

Validation:

  • static red/green reference-lifetime audit across all negative return paths
  • verified that error cleanup runs after GIL restoration
  • git diff --check

I could not run the 3FS/FUSE integration path locally.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/deepseek-ai/3FS/pull/422 **Author:** [@030611](https://github.com/030611) **Created:** 8/11/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/usrbio-prepare-error-ref` --- ### 📝 Commits (1) - [`5ebc19c`](https://github.com/deepseek-ai/3FS/commit/5ebc19ced83d9718b8a88541d5a97fc81a0d1cda) fix(python): release userdata on prepare failure ### 📊 Changes **1 file changed** (+13 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/py/usrbio_binding.cc` (+13 -10) </details> ### 📄 Description The Python binding retains userdata manually so an asynchronous completion can return it later. When hf3fs_prep_io() returns a negative errno, no completion will be produced, but the retained reference was previously left behind. Limit the GIL release to the native prepare call and release the manual reference on the error path after the GIL has been restored. The successful prepare/completion ownership path is unchanged. This is separate from the userdata/iov reference cycle addressed by #421. Validation: - static red/green reference-lifetime audit across all negative return paths - verified that error cleanup runs after GIL restoration - git diff --check I could not run the 3FS/FUSE integration path locally. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/3FS#426
No description provided.