-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
G-API: Fix streaming hangs for ConstSource & Improve troubleshooting logger messages #21567
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -323,16 +323,40 @@ class QueueReader | |
void rewindToStop(std::vector<Q*> &in_queues, | ||
const std::size_t this_id) | ||
{ | ||
for (auto &&qit : ade::util::indexed(in_queues)) | ||
{ | ||
auto id2 = ade::util::index(qit); | ||
auto &q2 = ade::util::value(qit); | ||
if (this_id == id2) continue; | ||
size_t expected_stop_count = std::count_if(in_queues.begin(), in_queues.end(), [] (const Q* ptr) { | ||
return ptr != nullptr; | ||
}); | ||
|
||
Cmd cmd; | ||
while (q2 && !cv::util::holds_alternative<Stop>(cmd)) | ||
q2->pop(cmd); | ||
if (expected_stop_count > 0) { | ||
// NB: it requires to substract own queues id from total waiting queue count | ||
// because it had got stop message before rewind was called | ||
expected_stop_count--; | ||
} | ||
GAPI_LOG_DEBUG(nullptr, "id: " << this_id << ", queues count: " << in_queues.size() << | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure that it's can somehow help user There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is still a debug message, we have some already so I'd not care about this one There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it, then @sivanov-work you can ignore these comments :) |
||
", expected stop msg count: " << expected_stop_count); | ||
size_t got_stop_count = 0; | ||
while(got_stop_count < expected_stop_count) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. space after |
||
for (auto &&qit : ade::util::indexed(in_queues)) { | ||
auto id2 = ade::util::index(qit); | ||
auto &q2 = ade::util::value(qit); | ||
if (this_id == id2) continue; | ||
|
||
GAPI_LOG_DEBUG(nullptr, "drain next id: " << id2 << | ||
TolyaTalamanov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
", stop count (" << got_stop_count << "/" << | ||
expected_stop_count << ")"); | ||
bool got_cmd = true; | ||
while (q2 && got_cmd) { | ||
Cmd cmd; | ||
got_cmd = q2->try_pop(cmd); | ||
if (got_cmd && cv::util::holds_alternative<Stop>(cmd)) { | ||
got_stop_count ++; | ||
GAPI_LOG_DEBUG(nullptr, "got stop from id: " << id2); | ||
TolyaTalamanov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
break; | ||
} | ||
} | ||
} | ||
} | ||
GAPI_LOG_DEBUG(nullptr, "completed"); | ||
TolyaTalamanov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
// This method handles a stop sign got from some input | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remind me how queue can be nullptr, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please check it on
https://github.com/opencv/opencv/pull/21567/files#diff-cda081454a6bb41f99d9185411a49d41065a601b92faa97f5669f9c23b60056eL397