TaskWeaver icon indicating copy to clipboard operation
TaskWeaver copied to clipboard

The Chainlit web service freezes after the code_interpreter crashes, and port 8000 is unable to serve requests externally.

Open kuantian-zhang opened this issue 10 months ago • 4 comments
trafficstars

Describe the bug I start TaskWeaver with chainlit run app.py, and the configuration for code execution is execution_service.kernel_mode=local. Sometimes, when a task reaches code_interpreter and the session stops, the Chainlit web service freezes and can no longer provide any service. Has anyone encountered the same issue?

To Reproduce Steps to reproduce the behavior:

  1. Start the service chainlit run app.py
  2. Type the user query "xxx" 从 sql_pull_data 中获取 ds>='20250101' and ds<='20250105' 按 ds 汇总的 count、max/min emq_timestamp 值
  3. Wait for the response
  4. The web UI shows no exceptions and stays stuck at the 'executing code...' stage.
  5. the chainlit server's log as below
2025-01-14 17:45:22 - Session 20250114-094522-7032e723 is initialized
2025-01-14 17:45:22 - CodeGenerator initialized successfully
2025-01-14 17:45:22 - CodeInterpreter initialized successfully.
2025-01-14 17:45:22 - Planner initialized successfully
Starting new session
Stopping session 20250114-094522-7032e723
2025-01-14 17:45:24 - Session 20250114-094522-7032e723 is stopped
2025-01-14 17:45:24 - CodeInterpreter closed successfully
2025-01-14 17:45:24 - CodeInterpreter closed successfully
  1. refresh the UI web, chainlit server stucked, Checking the TaskWeaver-related processes, I found that the Chainlit process is running normally, and the code_interpreter does not stop even after the session is terminated

Image

Image

Image

Expected behavior A clear and concise description of what you expected to happen. NA if feel not applicable.

Screenshots If applicable, add screenshots to help explain your problem.

Environment Information (please complete the following information):

  • OS: Linux
  • Python Version: 3.10
  • LLM that you're using: GPT-3
  • Other Configurations except the LLM api/key related: no

Additional context Add any other context about the problem here.

kuantian-zhang avatar Jan 14 '25 10:01 kuantian-zhang

Could you try running it using the console mode instead of the chainlit mode? I'm trying to rule out simple issues.

liqul avatar Jan 14 '25 10:01 liqul

+1 easy to crash blocks production deployment

codewider avatar Jan 17 '25 03:01 codewider

When running in console mode, it works fine, but when using the chainlit web ui, an issue occurs. Could it be that after the chainlit session is closed, the Jupyter kernel process executing the code does not shut down, causing a deadlock ?

kuantian-zhang avatar Jan 17 '25 03:01 kuantian-zhang

I'm not sure the reason. Actually, Chainlit is only presented as something in the playground for testing purposes. We don't have bandwidth to develop and maintain our own UI. It is not recommended for serious usages.

liqul avatar Jan 17 '25 05:01 liqul