[JS] Fix is_generating check fails#3490
Open
Retribution98 wants to merge 3 commits intoopenvinotoolkit:masterfrom
Open
[JS] Fix is_generating check fails#3490Retribution98 wants to merge 3 commits intoopenvinotoolkit:masterfrom
Retribution98 wants to merge 3 commits intoopenvinotoolkit:masterfrom
Conversation
Signed-off-by: Kirill Suvorov <kirill.suvorov@intel.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a JS bindings race where the next generate() call can be scheduled before the native inference thread clears the is_generating flag in error paths, causing erroneous “already in progress” failures.
Changes:
- Reorders error handling in Whisper/VLM native inference threads to clear
is_generatingbefore callingreport_error(). - Updates LLM native inference thread error handling to clear
is_generating, report the error, thenfinalize()andreturn(preventing fall-through into the success path).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| src/js/src/whisper_pipeline/pipeline_wrapper.cpp | Clears is_generating before invoking report_error() on inference exceptions. |
| src/js/src/vlm_pipeline/vlm_pipeline_wrapper.cpp | Clears is_generating before invoking report_error() on inference exceptions. |
| src/js/src/llm_pipeline/llm_pipeline_wrapper.cpp | Clears is_generating and properly finalizes/returns on inference exceptions. |
You can also share your feedback on Copilot code review. Take the survey.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
You can also share your feedback on Copilot code review. Take the survey.
9034133 to
c4e82bf
Compare
|
.take |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Reset
is_generatingflag before callingreport_error()in the error path ofgeneratePerformInferenceThreadto prevent a race condition where the JS event loop could schedule the nextgenerate()call before the native thread clears the flag.CVS-182798
Checklist: