Skip to content

Commit

Permalink
Provide a timeout to the queue.get call in HttpServerSourceStage to…
Browse files Browse the repository at this point in the history
… avoid spinlocking (#1928)

* Only impacts the Python impl of this stage

Closes [#1910](#1910)

## 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: #1928
  • Loading branch information
dagardner-nv authored Oct 19, 2024
1 parent 47841d6 commit 5a2d71f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ def _generate_frames(self, subscription: mrc.Subscription) -> typing.Iterator[Me
# shutdown since we already returned an OK response to the client.
df = None
try:
df = self._queue.get(block=False)
# Intentionally not using self._queue_timeout here since that value is rather high
df = self._queue.get(block=False, timeout=0.1)
self._queue_size -= 1
except queue.Empty:
if (not self._http_server.is_running() or self.is_stop_requested()
Expand Down

0 comments on commit 5a2d71f

Please sign in to comment.