Skip to content

Troubleshooting / Function Execution Timeout

Function execution timeout can have multiple causes, and it needs to be identified based on different situations.

1. Executing a Time-Consuming Function 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 time limit is fixed at 60 seconds.

When the function execution time exceeds the time limit, the system will directly 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 Causes Solutions
The executed function exceeds the 60-second limit Executing functions in the editor is mainly for development / debugging, and should use smaller data sets and request volumes
Do not directly execute complete time-consuming tasks

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

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

The specific manifestations are:

  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. The function API call returns a status code 599, and the response contains EFuncTimeout (usually also containing TaskTimeout information) as follows:
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
}

Among them, the reqCost field is the time (in milliseconds) from the start of the function execution to when it was killed.

Possible causes and solutions:

Possible Causes Solutions
The executed function does not specify the timeout parameter, but the function execution exceeds the default timeout limit Contact the function developer to troubleshoot the error, including but not limited to:
The timeout parameter is set too short
The external system called within the function responds too slowly
The executed function specifies the timeout parameter (in seconds), and the function execution times out Same as above

The default function timeout is 30 seconds, and the maximum setting is 3600 seconds

X. Reference Guide