langflow icon indicating copy to clipboard operation
langflow copied to clipboard

Can't modify worker timeout

Open serafimalex opened this issue 1 year ago • 3 comments

Bug Description

Can't modify worker timeout, neither by CLI (using --worker-timeout 30) nor by env variable (LANGFLOW_WORKER_TIMEOUT=30).

Reproduction

  1. Add custom component to a flow
  2. Add 300+ seconds of sleep inside component code
  3. Run
  4. Flow doesn't timeout after 300s, runs indefinetely

Expected behavior

Flow should timeout after default timeout of 300s, or earlier if setting worker timeout to a lower value.

Who can help?

@italojohnny @ogabrielluiz @nicoloboschi

Operating System

Ubuntu Linux

Langflow Version

1.0.19

Python Version

None

Screenshot

No response

Flow File

No response

serafimalex avatar Nov 13 '24 15:11 serafimalex

The issue you're experiencing with the worker timeout not being applied could be due to several factors. Here are a few things to check and try:

  1. Ensure Correct Environment Variable Usage: Make sure that the LANGFLOW_WORKER_TIMEOUT environment variable is set correctly in your environment. You can verify this by printing the environment variable before running Langflow to ensure it's being recognized.

  2. CLI Argument Precedence: When using the CLI argument --worker-timeout, ensure that it is correctly passed in the command. The CLI argument should override the environment variable if both are set.

  3. Check for Overrides: Verify if there are any configurations or conditions in your setup that might override the timeout settings. Although I couldn't find specific conditions in the codebase that might override the worker timeout, it's worth checking your setup for any custom configurations.

  4. Logging for Debugging: Utilize the logging capabilities in Langflow to diagnose the issue. Set the log level to DEBUG using the LANGFLOW_LOG_LEVEL environment variable to capture detailed logs that might provide insights into why the timeout is not being applied [1].

  5. Review Code for Timeout Application: Ensure that the timeout is being correctly applied in the code. The timeout parameter should be set in the options dictionary when configuring the server process [2].

If these steps do not resolve the issue, it might be helpful to review any recent changes in the codebase or consult with the maintainers mentioned in your message for further assistance.

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Nov 13 '24 15:11 dosubot[bot]

It seems that the worker_timeout variable is set in main; it is set into the 'options' dict which is passed to the LangflowServer process but it is never accessed. @joaoguilhermeS @ogabrielluiz

serafimalex avatar Nov 15 '24 12:11 serafimalex

Hi @italojohnny , any updates/advice on this issue?

serafimalex avatar Dec 05 '24 13:12 serafimalex

Hi, @cimuletz. I'm Dosu, and I'm helping the langflow team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You reported an issue with Langflow where the worker timeout cannot be modified, causing flows to run indefinitely.
  • Attempts to set the timeout via CLI or environment variables have not resolved the issue on Ubuntu Linux with Langflow version 1.0.19.
  • Suggested troubleshooting steps included checking environment variables, CLI argument precedence, and logging for debugging.
  • You noted that the worker_timeout is set but never accessed in the code.
  • You reached out to contributors @joaoguilhermeS, @ogabrielluiz, and @italojohnny for further assistance.

Next Steps:

  • Please let us know if this issue is still relevant to the latest version of the langflow repository by commenting on this issue.
  • If I do not hear back, this issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

dosubot[bot] avatar Mar 06 '25 16:03 dosubot[bot]