Repository navigation
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #135
FeederDeleterbefore callingFeeder_::shutdown()and deletingFeeder_.DataFeeder::shutdown(),stopping_, andpush_mutex_to decouple worker shutdown from providereos_and prevent pushing buffers/EOS intoappsrcduring teardown.src/service-maker/sources/python/tests/test_feeder_shutdown.py.Reason
Previously, destroying a
Pipelineholding aFeederdestroyedFeeder_while the main thread still held the Python GIL, andDataFeeder::~DataFeeder()joined the feeder worker thread. If the worker was blocked insideBufferProvider.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 fromBufferProvider.generate()during teardown could reseteos_tofalse, preventing the worker thread from exiting or pushing into a tearing-downappsrc.Validation
ghcr.io/nvidia/deepstream:9.2-triton-multiarch, CUDA 13.2, TensorRT 10.16.0.72)developsource built on 9.2.0 base container)f6e5edfbash ./build/build.sh --package)CUDA_VER=13.2 TRT_VER=10.16.0.72) +scripts/install.shsucceeded;build/package.shstopped at TRT 11 version check (PACKAGE_TRT_MAJOR=11) due to TRT 10.16.0.72 in the 9.2.0 containersource4_1080p_dec_infer-resnet_tracker_sgie_tiled_display.txt(headlesssink0type=1)4m23s (wall-clock, including first-run TRT engine build)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:
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
NVIDIA/DeepStream:develop.NVIDIA/DeepStream:develop.bash ./build/build.sh --packagecompleted successfully.deepstream-appon x86 or Jetson.git commit -s).CHANGELOG.mdare updated, where applicable.