Skip to content

fix(python): release userdata reference when prepare fails - #422

Open
030611 wants to merge 1 commit into
deepseek-ai:mainfrom
030611:fix/usrbio-prepare-error-ref
Open

fix(python): release userdata reference when prepare fails#422
030611 wants to merge 1 commit into
deepseek-ai:mainfrom
030611:fix/usrbio-prepare-error-ref

Conversation

@030611

@030611 030611 commented Aug 11, 2026

Copy link
Copy Markdown

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.

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