Skip to content

Troubleshooting / Function Execution Timeout

Function execution timeout can have various causes, which need to be identified based on different situations.

1. Function Execution Takes Too Long in the DataFlux Func UI Editor

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

When a function's execution time exceeds this limit, the system will forcibly kill the process and throw 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 primarily for development/debugging purposes and should use smaller datasets and request volumes.
Do not directly execute full, long-running tasks.

2. Function Execution Takes Too Long, Causing the Worker Process to Be Killed

To protect the system, DataFlux Func imposes a limit on the maximum execution time of functions, preventing them from running indefinitely. After exceeding a certain duration, the execution process is forcibly killed.

Specific manifestations include:

  1. Observing errors containing TaskTimeout in the task execution logs, 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. Calling the function API returns a status code of 599, with response data containing EFuncTimeout (usually also containing TaskTimeout information), as shown below:
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
}

The reqCost field indicates the time elapsed (in milliseconds) from the start of the function execution until it was killed.

Possible causes and solutions:

Possible Cause Solution
The executed function did not specify a timeout parameter, but its runtime exceeded the default timeout limit. Contact the function developer to troubleshoot the error. This includes, but is not limited to:
- The timeout parameter is set too short.
- Calls to external systems within the function are responding too slowly.
The executed function specified a timeout parameter (in seconds), and the function execution timed out. Same as above.

The default function timeout is 30 seconds, with a maximum setting of 3600 seconds.

X. Reference Documentation