Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

fix(service-maker): release GIL when destroying Feeder and handle shu… - #156

Open
wyw1267 wants to merge 1 commit into
developfrom
fix/issue_135
Open

wyw1267 wants to merge 1 commit into
developfrom
fix/issue_135

Conversation

@wyw1267

@wyw1267 wyw1267 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Description

Fixes #135

  • Release the Python GIL in FeederDeleter before calling Feeder_::shutdown() and deleting Feeder_.
  • Introduce DataFeeder::shutdown(), stopping_, and push_mutex_ to decouple worker shutdown from provider eos_ and prevent pushing buffers/EOS into appsrc during teardown.
  • Add subprocess pytest regression coverage in src/service-maker/sources/python/tests/test_feeder_shutdown.py.

Reason

Previously, destroying a Pipeline holding a Feeder destroyed Feeder_ while the main thread still held the Python GIL, and DataFeeder::~DataFeeder() joined the feeder worker thread. If the worker was blocked inside BufferProvider.generate() in a GIL-releasing call, it needed the GIL to return, causing a deadlock.

In addition, eos_ was reused for both provider EOS and worker shutdown. A non-empty buffer returned from BufferProvider.generate() during teardown could reset eos_ to false, preventing the worker thread from exiting or pushing into a tearing-down appsrc.

Validation

Item Value
Platform (x86 GPU / Jetson, GPU or board, OS) x86_64, NVIDIA H100 80GB HBM3 (Driver 620.58), Ubuntu 24.04.4 LTS (in ghcr.io/nvidia/deepstream:9.2-triton-multiarch, CUDA 13.2, TensorRT 10.16.0.72)
DeepStream version 9.2 (9.2.1 develop source built on 9.2.0 base container)
Tested commit f6e5edf
Build result (bash ./build/build.sh --package) Full source build (CUDA_VER=13.2 TRT_VER=10.16.0.72) + scripts/install.sh succeeded; build/package.sh stopped at TRT 11 version check (PACKAGE_TRT_MAJOR=11) due to TRT 10.16.0.72 in the 9.2.0 container
Sanity config (source4) source4_1080p_dec_infer-resnet_tracker_sgie_tiled_display.txt (headless sink0 type=1)
Test duration 4m23s (wall-clock, including first-run TRT engine build)
Test result Pass. Additional tests: pytest -v src/service-maker/sources/python/tests/test_feeder_shutdown.py (2 passed in 2.39s), test_inject.py & test_basic.py (2 passed in 11.50s)

Known limitations / untested platforms:

  • Not tested on Jetson, IGX Thor, or ARM SBSA / DGX Spark.
  • Packaging (build/package.sh) was not completed locally because the available container ships TensorRT 10.16.0.72 rather than the 9.2.1 TensorRT 11 baseline.

Checklist

  • My working branch is based on NVIDIA/DeepStream:develop.
  • The PR targets NVIDIA/DeepStream:develop.
  • bash ./build/build.sh --package completed successfully.
  • The source4 sanity test passed with the newly built deepstream-app on x86 or Jetson.
  • The PR records the tested platform, software version, commit, source4 configuration, test duration, and results.
  • Additional tests relevant to the change passed, where applicable.
  • My submitted commits include contributor sign-off (git commit -s).
  • Affected documentation and CHANGELOG.md are updated, where applicable.

…tdown EOS

1.release the Python GIL in FeederDeleter before joining DataFeeder's worker thread
2.separate the shutdown flag (stopping_) from provider EOS (eos_) so a non-empty buffer returned during teardown cannot prevent the worker from exiting or push into a stopping appsrc.

Signed-off-by: yuweiw <yuweiw@nvidia.com>
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