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

fix(service-maker): release GIL during pipeline stop - #115

Draft
chunlinl1980 wants to merge 1 commit into
developfrom
fix/99-pipeline-stop-gil
Draft

chunlinl1980 wants to merge 1 commit into
developfrom
fix/99-pipeline-stop-gil

Conversation

@chunlinl1980

Copy link
Copy Markdown
Collaborator

Description

Fixes #99.

Release the GIL around the Python binding of Pipeline::stop() using py::call_guard<py::gil_scoped_release>(), preserving the existing return value. Document the shutdown behavior and add subprocess regression tests for shutdown with and without a Python streaming probe.

Reason

stop() sends EOS and can wait for a streaming lock while retaining the GIL. A streaming thread holding that lock may need the GIL to finish its Python probe, deadlocking shutdown and other Python threads. Releasing the GIL allows the callback to complete.

This addresses the GIL/streaming-lock deadlock during playback; it does not guarantee bounded shutdown for an otherwise stalled pipeline.

Validation

Item Value
Platform (x86 GPU / Jetson, GPU or board, OS) x86_64, RTX 4090, Ubuntu 24.04.3, driver 595.71.05; targeted tests use CPU-only videotestsrc/fakesink
DeepStream version 9.2.0
Tested commit 951f368; identical working-tree content tested before committing
Build result (bash ./build/build.sh --package) Outstanding
Component build Python extension compiled successfully against the installed SDK; tested via an isolated Python package directory
Sanity config (source4) source4_1080p_dec_infer-resnet_tracker_sgie_tiled_display.txt; new-build validation outstanding
Test duration Targeted regression suite: 5.00 s
Test result Two tests passed, exercising 10 shutdown cycles each, with and without a probe

Additional verification:

  • Against the stock SDK, the finalized no-probe test passes and the probe case reaches the 10-second watchdog timeout (one passed, one failed).
  • With the rebuilt binding, the original issue reproducer completes all 10 probe shutdown cycles.
  • git diff --check passes.

The full build/package and source4 test with newly built binaries remain outstanding. Jetson is untested. The installed SDK was not replaced. Keep this PR in draft pending acceptance validation.

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 is updated.

Release the Python GIL while stop sends EOS so streaming probes can finish. Preserve the binding return value and add subprocess regression coverage for shutdown with and without a Python probe.

Fixes #99

Signed-off-by: chunlinl <chunlinl@nvidia.com>
@chunlinl1980
chunlinl1980 requested a review from nvankita November 4, 2026 23:37
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