fix: process_video silent hang on callback error#2022
fix: process_video silent hang on callback error#2022Borda merged 13 commits intoroboflow:developfrom
process_video silent hang on callback error#2022Conversation
|
@realh4m, thank you for your contribution and suggested fix. Could you also include a test to verify that it resolves the issue? 🦩 |
process_video silent hang on callback error
There was a problem hiding this comment.
Pull request overview
This PR fixes a silent hang issue in process_video when the callback function raises an exception during video processing. The fix ensures that exceptions are caught, the pipeline is properly shut down, and the error is re-raised to the caller.
Changes:
- Added exception tracking (
exception_in_worker) to capture and re-raise callback errors - Introduced
read_finishedflag to conditionally drain the read queue in the finally block - Modified the finally block to drain remaining frames from the read queue when an exception occurs, preventing deadlock
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0406081 to
fce63f8
Compare
|
Thank you for the feedback. I've added unit tests in |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #2022 +/- ##
=======================================
+ Coverage 59% 60% +1%
=======================================
Files 61 61
Lines 7086 7108 +22
=======================================
+ Hits 4193 4287 +94
+ Misses 2893 2821 -72 🚀 New features to boost your workflow:
|
|
Hi @realh4m 👋🏻 Thanks a lot for your interest in supervision drafting this PR. I'm actually working on slightly deper rewrite of that whole function, here: #2102. I want to keep the trace of your contribution so I'll most likely merge my changes into your branch once I'm done, and we will merge it from here. |
|
Sounds good. I'll wait for your updates. Thanks. |
…om/realh4m/supervision into fix/video-worker-error-propagation
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@SkalskiP I would be in favor of merging this one as is, since it adds a handful of tests. If you have a better refactor, you can still overwrite/replace it with yours... |
Description
Added exception tracking in
process_videoso callback errors raised in the worker loop are surfaced after reader/writer threads finish, preventing silent hangs when the callback crashes mid-stream.Introduced
read_finishedto avoid draining the read queue unnecessarily once EOF is reached.process_videocould hang without any error when the callback raised an exception.Type of change
How has this change been tested, please provide a testcase or example of how you tested the change?
Verified locally with a callback that raises an exception.
Any specific deployment considerations
No additional considerations; behavior change only affects
process_videoerror handling.Docs