Skip to content

Troubleshooting / Function Execution Timeout

There are various possible reasons for function execution timeout, which need 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 will ignore the timeout configuration, and the time limit is fixed at 45 seconds.

After 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 Cause Solution
The executed function runs beyond the 45-second limit Executing functions in the editor is mainly used for development / debugging; small datasets and request volumes should be used.
Do not directly execute long-running tasks

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

To protect the system, DataFlux Func imposes a maximum execution time limit for functions and does not allow unlimited execution. If a certain period of time is exceeded, the execution process will be directly killed.

Specific manifestations include:

  1. Observing errors containing SoftTimeLimitExceeded in the task execution logs, 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. Synchronous API calls (Old version: authorized links) return status code 599, with data including EFuncTimeout (generally also includes 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/auln-xxxxx"
    },
    "traceId": "TRACE-xxxxx"
}

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

Possible causes and solutions:

Possible Cause Solution
The executed function does not specify a timeout parameter, but the function runs beyond the default timeout limit Contact the function developer to investigate errors, including but not limited to:
Timeout parameter set too short
Slow response from external systems called within the function
The executed function specifies a timeout parameter (in seconds), and the function runs beyond this limit Same as above

Default function timeout is 30 seconds, maximum setting is 3600 seconds

X. Reference Documents