Skip to content

Pushing docker images using gitea actions/act_runner times out due to slow DB update #33734

@LouisVallat

Description

@LouisVallat

Description

Often, when having multiple CI running using act_runner (on another server) and gitea actions, docker image uploads get stuck, returns a 504 Gateway time out (using an nginx reverse proxy), logs shows database updates sometimes running for 3 minutes, causing these timeout issues.
I changed hosts twice, nothing appears in gitea doctor nor in the gitea admin self check.

The issue seems to be caused by this:

Feb 26 20:34:55 gitea gitea[166172]: 2025/02/26 20:34:55 ...dules/actions/log.go:73:WriteLogs() [W] [Slow SQL Query] UPDATE dbfs_data SET revision=revision+1, blob_data=$1 WHERE meta_id=$2 AND blob_offset=$3 [[50 48 50 53 45 48 50 45 50 54 84 49 57 58 50 52 58 52 52 46 49 51 55 50 49 55 55 90 32 104 111 109 101 108 97 98 40 118 101 114 115 105 111 <TRUNCATED> 66 32 51 56 56 46 53 115 10] 1311 0] - 3m33.427483567s
Feb 26 20:34:55 gitea gitea[166172]: 2025/02/26 20:34:55 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/UpdateLog for [2001:<REDACTED>]:0, 500 Internal Server Error in 213484.3ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)

It looks like the update query took 3m33.427483567s, causing a 500 error (in a request that took 213484.3ms).
Could this happen due to an influx of AI scraper bots?

Gitea Version

1.23.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

git version 2.39.5

Operating System

Debian 12

How are you running Gitea?

I am running a manual install of Gitea (binary, systemd) on a Debian 12 server, with Redis and Postgres.
There is plenty of disk space, memory headroom and disk IOPS to spare, IOWAIT is kept under 1%.
The instance is setup behind a reverse proxy.

Database

PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions