Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue where Python sources can deadlock when the subscriber is unsubscribed #495

Conversation

dagardner-nv
Copy link
Contributor

@dagardner-nv dagardner-nv commented Aug 29, 2024

Description

  • Ensures that Python source nodes shutdown when their subscriber is unsubscribed
  • Advance the underlying Python iterator inside of it's own thread pushing values to a queue.
  • Execute generator in a thread created by the Python interpreter, this allows us to stop the thread on shutdown via the CPython API by raising an exception in the thread.
  • Remove unused json usage in python/mrc/_pymrc/src/utilities/acquire_gil.cpp
  • Update conftest.py to set the loglevel to DEBUG if the GLOG_v environment variable is defined.

Closes nv-morpheus/Morpheus#1838

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@dagardner-nv dagardner-nv requested review from a team as code owners August 29, 2024 18:33
@dagardner-nv dagardner-nv self-assigned this Aug 29, 2024
@dagardner-nv dagardner-nv added bug Something isn't working non-breaking Non-breaking change labels Aug 29, 2024
@dagardner-nv dagardner-nv marked this pull request as draft August 29, 2024 18:35
@dagardner-nv dagardner-nv marked this pull request as ready for review August 29, 2024 19:59
@dagardner-nv dagardner-nv marked this pull request as draft August 29, 2024 20:20
Copy link

codecov bot commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 89.79592% with 10 lines in your changes missing coverage. Please review.

Project coverage is 74.16%. Comparing base (ca8a73f) to head (8b4c59c).

Files with missing lines Patch % Lines
python/mrc/_pymrc/src/segment.cpp 89.69% 10 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff                @@
##           branch-24.10     #495      +/-   ##
================================================
+ Coverage         74.06%   74.16%   +0.10%     
================================================
  Files               403      403              
  Lines             14403    14475      +72     
  Branches           1132     1143      +11     
================================================
+ Hits              10667    10736      +69     
- Misses             3736     3739       +3     
Flag Coverage Δ
cpp 70.46% <1.02%> (-0.35%) ⬇️
py 42.78% <91.66%> (+0.95%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
python/mrc/_pymrc/include/pymrc/segment.hpp 62.50% <ø> (ø)
python/mrc/_pymrc/src/utilities/acquire_gil.cpp 57.14% <ø> (ø)
python/mrc/core/segment.cpp 95.78% <100.00%> (+0.04%) ⬆️
python/mrc/_pymrc/src/segment.cpp 84.27% <89.69%> (+2.58%) ⬆️

... and 8 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca8a73f...8b4c59c. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working non-breaking Non-breaking change
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[BUG]: Python source stages not shutting down if another stage raises an exception
1 participant