Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: replace anyio.Lock with asyncio.Lock to resolve lock handling issues #1871

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

Closed

Conversation

sergey21000
Copy link

Fixes #1861

Using llama_cpp.server with "stream": true parameter resulted in RuntimeError: The current task is not holding this lock error.
Using asyncio.Lock() instead of anyio.Lock() fixes this error.

@agronholm
Copy link

If this happens, then something else is being done wrong. Simply bypassing such checks isn't going to fix the root issue.

@gjpower
Copy link
Contributor

gjpower commented Dec 23, 2024

I fixed this in #1879 it required opening the exit_stack for streaming request inside the streaming response handler. This prevents the attempting at trying to close it from a different task in which it was opened. It required a larger refactor to correct the issue

@sergey21000
Copy link
Author

Superseded by #1879

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.

Crash due to "The current task is not holding this lock" when {"stream": true}
3 participants