Stop button not working on backend.
Bug Description
The stop button only stops the request on the frontend.
Reproduction
- Create a flow
- Create a custom component
- Add a time.sleep(1000) into the build function of the component
- Run the component
- Stop the build
- Check that the backend is still running the flow, preventing other calls to be made.
Expected behavior
The backend should stop the build so that we can make other calls to the backend.
Who can help?
@italojohnny
Operating System
Macbook M3 Pro
Langflow Version
main
Python Version
3.10
Screenshot
No response
Flow File
No response
Users should use asyncio.sleep, not time.sleep. There's no way we can avoid blocking the entire application.
I'd suggest to mitigate the problem by giving validation error if we detect time.sleep in the component code, suggesting to use await asyncio.sleep(x) instead.
The validation is still "overridable" because you could by-pass it in multiple ways (e.g. t = time;t.sleep(1)) but at least will avoid unconscious errors.
This issue is already resolved!