Skip to content

Troubleshooting / Function Execution Timeout

Function execution timeouts may have multiple possible causes and need to be diagnosed according to the specific situation.

1. Executing functions that take too long in the DataFlux Func UI editor

To protect the system, when executing functions in the DataFlux Func editor, the system ignores the timeout configuration, and the time limit is fixed at 60 seconds.

When a function runs longer than the time limit, the system directly kills the process and throws an error similar to the following:

Text Only
1
2
3
4
Traceback (most recent call last **IN USER SCRIPT**):
  File "demo__test_timeout", line 5, in test_timeout
    time.sleep(100)
worker.tasks.TaskTimeout: Task execution has taken too much time and has been killed by force
Possible Cause Solution
The executed function runs longer than the 60-second limit Executing functions in the editor is mainly for development / debugging, so smaller datasets and request volumes should be used
Do not directly execute complete long-running tasks

2. Function execution takes too long and causes the worker process to be killed

To protect the system, DataFlux Func imposes a limit on the maximum execution time of functions and does not allow functions to run indefinitely. After exceeding a certain time, the execution process is killed directly.

Specifically:

  1. In the task execution logs, errors containing TaskTimeout are observed, such as:
Text Only
1
2
3
4
Traceback (most recent call last **IN USER SCRIPT**):
  File "demo__test_timeout", line 5, in test_timeout
    time.sleep(100)
worker.tasks.TaskTimeout: Task execution has taken too much time and has been killed by force
  1. When the Func API is called, status code 599 is returned, along with the following data containing EFuncTimeout (usually also containing TaskTimeout information):
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
  "ok"     : false,
  "error"  : 599.2,
  "status" : 599,
  "reason" : "EFuncTimeout",
  "message": "Func task timeout",
  "detail": {
    "name"               : "Func.Runner",
    "id"                 : "task-xxxxx",
    "triggerTime"        : 1755596408.972,
    "startTime"          : 1755596408.974,
    "endTime"            : 1755596411.979,
    "status"             : "timeout",
    "exceptionType"      : "TaskTimeout",
    "exception"          : "TaskTimeout('Task execution has taken too much time and has been killed by force')",
    "exceptionFrom"      : "worker",
    "originExceptionType": "TaskTimeout",
    "originException"    : "TaskTimeout('Task execution has taken too much time and has been killed by force')"
  },
  "reqDump": {
    "method": "GET",
    "url"   : "http://localdev:8089/api/v1/func-api/demo__test_timeout.test_timeout.xxxxx/s"
  },
  "traceId"   : "TRACE-XXXXX",
  "clientTime": null,
  "reqTime"   : "2025-08-19T09:40:08.967Z",
  "respTime"  : "2025-08-19T09:40:12.140Z",
  "reqCost"   : 3173
}

Here, the reqCost field is the time elapsed (in milliseconds) from when the function started executing until it was killed.

Possible causes and solutions:

Possible Cause Solution
The executed function does not specify the timeout parameter, but runs longer than the default timeout limit Contact the function developer to troubleshoot the error, including but not limited to:
The timeout parameter is set too short
External systems called within the function respond too slowly
The executed function specifies the timeout parameter (in seconds), and the function exceeds the timeout Same as above

Function timeout defaults to 30 seconds, and the maximum setting is 3600 seconds

X. Reference Documentation