Skip to content

Troubleshooting / Function Execution Timeout

Function execution timeout can have various causes, and different situations need to be distinguished.

1. Executing a Long-Running 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 execution time limit is fixed at 45 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
5
6
7
8
#1 --------------------
Executing function: demo__demo.test_timeout()

Error stack:
Traceback (most recent call last):
  File "demo__demo", line 4, in test_timeout
    time.sleep(100)
billiard.exceptions.SoftTimeLimitExceeded: SoftTimeLimitExceeded()
Possible Causes Solutions
The executed function runs over the 45-second limit Executing functions in the editor is mainly for development/debugging, and should use smaller datasets and request volumes
Do not directly execute full-length 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 unlimited running. After exceeding a certain time, the execution process will be directly killed.

Specific manifestations:

  1. In the logs of task execution, errors containing SoftTimeLimitExceeded are observed, such as:
Text Only
1
2
3
4
Traceback (most recent call last):
  File "demo__demo", line 4, in test_timeout
    time.sleep(100)
billiard.exceptions.SoftTimeLimitExceeded: SoftTimeLimitExceeded()
  1. Calling the function API returns status code 599, and the response contains EFuncTimeout (usually also containing SoftTimeLimitExceeded information) as follows:
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
{
    "detail": {
        "einfoTEXT": "raise SoftTimeLimitExceeded()\nbilliard.exceptions.SoftTimeLimitExceeded: SoftTimeLimitExceeded()",
        "id": "task-xxxxx"
    },
    "error": 599.31,
    "message": "Calling Function timeout.",
    "ok": false,
    "reason": "EFuncTimeout",
    "reqCost": 5020,
    "reqDump": {
        "method": "GET",
        "url": "/api/v1/al/func-api-xxxxx"
    },
    "traceId": "TRACE-xxxxx"
}

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

Possible causes and solutions:

Possible Causes Solutions
The executed function does not specify the timeout parameter, but the function runs over the default timeout limit Contact the function developer to troubleshoot the error, including but not limited to:
Timeout parameter set too short
External system calls within the function respond 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, with a maximum setting of 3600 seconds

X. Reference Guide