Skip to content
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

fix: prevent AssertionError by setting max_workers to 1 #154

Merged
merged 3 commits into from
Mar 11, 2025

Conversation

eliteprox
Copy link
Collaborator

@eliteprox eliteprox commented Mar 11, 2025

This change resolves #124 which is caused by concurrent worker processes loading the same models in certain workflows.

This change also handles WebRTC data channel errors during frame processing in app.py to resolve #135. Please note these are separate issues.

max_workers had been set to 5 in #10 to allow for more than a single workflow to be executed simultaneously, however, we must refactor the solution to ensure that prompts are always queued to the same worker process, otherwise this error will occur. (See #73)

This issue was also occurring intermittently midstream due to the active worker process queuing long enough to prompt comfystream api server to start a 2nd worker.

Copy link
Collaborator

@varshith15 varshith15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some nit comments, otherwise LGTM

@eliteprox eliteprox merged commit fc0f6ef into main Mar 11, 2025
1 check passed
@hjpotter92 hjpotter92 deleted the fix/assertion-error branch March 12, 2025 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Prevent frame retrieval after track ended [BUG] AssertionError when running ComfyStream workflows
2 participants