fix: distinguish transient plugin-not-installed from truly invalid pipeline ID (#936)#938
Open
livepeer-tessa wants to merge 1 commit intomainfrom
Open
fix: distinguish transient plugin-not-installed from truly invalid pipeline ID (#936)#938livepeer-tessa wants to merge 1 commit intomainfrom
livepeer-tessa wants to merge 1 commit intomainfrom
Conversation
…peline ID (#936) Signed-off-by: Tessa (livepeer-tessa) <tessa@livepeer.org>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
🚀 fal.ai Preview Deployment
Livepeer Runner
Testing Livepeer Mode |
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.
Summary
Fixes #936
At cloud session init the frontend sends two concurrent requests — one to install a plugin and one to load its pipeline. If the load request arrives before the plugin finishes registering,
_load_pipeline_implementationfalls through to a genericValueError("Invalid pipeline ID: ..."))and_load_pipeline_by_id_synclogs it at ERROR level with the unhelpfulconsider removing the models directorysuggestion. The session recovers silently on the next retry (~1-2 min), but the misleading error creates confusion.Changes
1. New exception class —
PipelineNotYetRegisteredExceptionAdded
PipelineNotYetRegisteredException(ValueError)near the top ofpipeline_manager.py. This makes the transient case distinguishable from a genuinely unknown pipeline ID.2.
_load_pipeline_implementation— raise typed exceptionThe final
else: raise ValueError(f"Invalid pipeline ID: {pipeline_id}")is nowraise PipelineNotYetRegisteredException(...). No other code paths change.3.
_load_pipeline_by_id_sync— catch before generic handlerAdded a dedicated
except PipelineNotYetRegisteredExceptionclause before the existingexcept Exceptionblock:NOT_LOADED(notERROR) so the frontend never shows an error state and the load can be retried transparently once the plugin finishes installing.4. Tests
New file
tests/test_pipeline_race_condition.py(9 tests):PipelineNotYetRegisteredExceptionis raised for unknown non-builtin IDs._load_pipeline_by_id_syncreturnsFalsewithout setting status toERROR.