You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When LangChain calls the ChatOllama module, in some cases the request is interrupted, but LangChain continues to wait for a response from Ollama, causing the program to hang.
#31549
In my code, data is provided to the LLM multiple times for reasoning, and this process may repeat thousands or even tens of thousands of times.
Everything works fine when the code initially runs, but at some point during the loop execution, LangChain ends up indefinitely waiting for a response from Ollama.
I used py-spy to analyze the current process stack and found that it was stuck waiting for an HTTP response:
This issue only occurs after a certain number of executions, which makes it difficult to debug.
I also tried upgrading Ollama and switching models, but the problem still persists.
I can confirm that the context length I provide each time does not exceed the model’s maximum limit:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Calling invoke, these steps don’t involve very complex processing:
Description
In my code, data is provided to the LLM multiple times for reasoning, and this process may repeat thousands or even tens of thousands of times.
Everything works fine when the code initially runs, but at some point during the loop execution, LangChain ends up indefinitely waiting for a response from Ollama.
I used py-spy to analyze the current process stack and found that it was stuck waiting for an HTTP response:


This issue only occurs after a certain number of executions, which makes it difficult to debug.
I also tried upgrading Ollama and switching models, but the problem still persists.
I can confirm that the context length I provide each time does not exceed the model’s maximum limit:
System Info
python 3.11.11
langchain version:
system:
macos 15.1.1
&&
ubuntu 5.15.0-141-generic
Beta Was this translation helpful? Give feedback.
All reactions