Skip to content

Fix AIS subprocess lifetime when opening datastore objects#15837

Open
fallintoplace wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
fallintoplace:fix/ais-binary-stream-lifetime
Open

Fix AIS subprocess lifetime when opening datastore objects#15837
fallintoplace wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
fallintoplace:fix/ais-binary-stream-lifetime

Conversation

@fallintoplace

Copy link
Copy Markdown

Important

The Update branch button must only be pressed in very rare occassions.
An outdated branch is never blocking the merge of a PR.
Please reach out to the automation team before pressing that button.

What does this PR do ?

Fix open_datastore_object_with_binary() so AIS-backed file objects stay usable after the helper returns.

Collection: Common

Changelog

  • replace the with subprocess.Popen(...) return path with a small stream wrapper that owns the AIS subprocess
  • keep the subprocess alive until the caller closes the returned stream, then close the pipes and wait for the process
  • add unit coverage for the success path and the retry/error path around AIS binary reads

Usage

with open_datastore_object_with_binary("ais://bucket/object") as stream:
    chunk = stream.read(4096)

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to #
  • I couldn't run pytest in this checkout because the active interpreter is missing the project test dependencies, but I did add focused unit coverage and exercised the changed subprocess path with a direct smoke check.

@copy-pr-bot

copy-pr-bot Bot commented Jun 27, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Signed-off-by: Minh Vu <vuhoangminh97@gmail.com>
@fallintoplace fallintoplace force-pushed the fix/ais-binary-stream-lifetime branch from c3a6bf5 to 6f85e2e Compare June 27, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants