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

[BUG]: Many Python source stages do not stop if the user hits Ctrl+C #1837

Closed
2 tasks done
dagardner-nv opened this issue Aug 8, 2024 · 1 comment · Fixed by #1839
Closed
2 tasks done

[BUG]: Many Python source stages do not stop if the user hits Ctrl+C #1837

dagardner-nv opened this issue Aug 8, 2024 · 1 comment · Fixed by #1839
Assignees
Labels
bug Something isn't working

Comments

@dagardner-nv
Copy link
Contributor

dagardner-nv commented Aug 8, 2024

Version

24.10

Which installation method(s) does this occur on?

Source

Describe the bug.

This primarily impacts sources which run indefinitely (HttpClientSourceStage, AppShieldSourceStage, RSSSourceStage). The Kafka source stage currently does the correct thing and shuts down when requested, fix should just be to promote that shutdown code to the base class.

Minimum reproducible example

Relevant log output

Click here to see error details

[Paste the error here, it will be hidden by default]

Full env printout

Click here to see environment details

[Paste the results of print_env.sh here, it will be hidden by default]

Other/Misc.

No response

Code of Conduct

  • I agree to follow Morpheus' Code of Conduct
  • I have searched the open bugs and have found no duplicates for this bug report
@dagardner-nv dagardner-nv added the bug Something isn't working label Aug 8, 2024
@dagardner-nv dagardner-nv self-assigned this Aug 8, 2024
@dagardner-nv dagardner-nv changed the title [BUG]: HttpServer deadlocks if the user hits Ctrl+C or another stage raises an exception [BUG]: Python impl of HttpServerSourceStage deadlocks if the user hits Ctrl+C or another stage raises an exception Aug 8, 2024
@dagardner-nv dagardner-nv changed the title [BUG]: Python impl of HttpServerSourceStage deadlocks if the user hits Ctrl+C or another stage raises an exception [BUG]: Many Python source stages do not stop if the user hits Ctrl+C Aug 9, 2024
@dagardner-nv
Copy link
Contributor Author

Related to #1838

@morpheus-bot-test morpheus-bot-test bot moved this from Todo to Review - Ready for Review in Morpheus Boards Aug 9, 2024
rapids-bot bot pushed a commit that referenced this issue Aug 14, 2024
* Ensure that Python sources which run indefinitely actually shutdown when requested by the pipline (ex: when the user hits Ctrl+C).
* The `KafkaSourceStage` already handled this properly, move the `stop` method from this class into the `SingleOutputSource`.
* Add `request_stop` and `is_stop_requested` methods to `SingleOutputSource`.
* Update all existing source stages which run indefinitely.
* Add new `should_stop_fn` constructor argument to `DirectoryWatcher`, sources which use the watcher (`AutoencoderSourceStage` & `AppShieldSourceStage`) pass in their `is_stop_requested` method allowing the watcher to know when to shut down.
* Move the RSS source generator method from the RSS source module into the `RSSController`, and update the `RSSSourceStage` to use the `RSSController` directly rather than the RSS module. This avoids the problem where modules require all config values to be JSON serializable, preventing a callback function from being passed to a module.

Closes #1837

## By Submitting this PR I confirm:
- I am familiar with the [Contributing Guidelines](https://github.com/nv-morpheus/Morpheus/blob/main/docs/source/developer_guide/contributing.md).
- When the PR is ready for review, new or existing tests cover these changes.
- When the PR is ready for review, the documentation is up to date with these changes.

Authors:
  - David Gardner (https://github.com/dagardner-nv)

Approvers:
  - Michael Demoret (https://github.com/mdemoret-nv)

URL: #1839
@github-project-automation github-project-automation bot moved this from Review - Ready for Review to Done in Morpheus Boards Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant