]> source.dussan.org Git - gitea.git/commit
Fix content holes in Actions task logs file (#25560)
authorJason Song <i@wolfogre.com>
Wed, 28 Jun 2023 17:07:29 +0000 (01:07 +0800)
committerGitHub <noreply@github.com>
Wed, 28 Jun 2023 17:07:29 +0000 (19:07 +0200)
commit6daf21c9b722e31ea5e3b1ec48caa69327580abd
treed689df26a38ed3a6124d475613c4f899127aa7bf
parentb6693a2c9a6010463950bbd89a2bfee88bde5e5f
Fix content holes in Actions task logs file (#25560)

Fix #25451.

Bugfixes:
- When stopping the zombie or endless tasks, set `LogInStorage` to true
after transferring the file to storage. It was missing, it could write
to a nonexistent file in DBFS because `LogInStorage` was false.
- Always update `ActionTask.Updated` when there's a new state reported
by the runner, even if there's no change. This is to avoid the task
being judged as a zombie task.

Enhancement:
- Support `Stat()` for DBFS file.
- `WriteLogs` refuses to write if it could result in content holes.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
models/actions/task.go
models/dbfs/dbfile.go
models/dbfs/dbfs.go
models/dbfs/dbfs_test.go
modules/actions/log.go
services/actions/clear_tasks.go