Skip to content

metadata: write metadata.json early so it survives a hard kill#288

Merged
bhcopeland merged 1 commit into
kernelci:masterfrom
roxell:metadata-early-write
Jun 17, 2026
Merged

metadata: write metadata.json early so it survives a hard kill#288
bhcopeland merged 1 commit into
kernelci:masterfrom
roxell:metadata-early-write

Conversation

@roxell

@roxell roxell commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

tuxmake writes metadata.json once, in the finally block of run(). A graceful failure like a compile error or a SIGTERM still runs the finally, so we get the file.

A hard kill does not. SIGKILL, the OOM killer or a CI kill -9 cannot be caught, so the finally never runs and we get no metadata.json. We lose data we already knew, like the compiler and tool versions.

Now collect in two steps. After prepare() write the parts that do not depend on the build. At the end add the build results and write again. source stays late because kernelrelease may need a config.

A finished build gets the same file as before. A killed build now keeps a partial file with the early data and no results key.

tuxmake writes metadata.json once, in the finally block of run(). A
graceful failure like a compile error or a SIGTERM still runs the
finally, so we get the file.

A hard kill does not. SIGKILL, the OOM killer or a CI kill -9 cannot be
caught, so the finally never runs and we get no metadata.json. We lose
data we already knew, like the compiler and tool versions.

Now collect in two steps. After prepare() write the parts that do not
depend on the build. At the end add the build results and write again.
source stays late because kernelrelease may need a config.

A finished build gets the same file as before. A killed build now keeps
a partial file with the early data and no results key.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
@roxell
roxell force-pushed the metadata-early-write branch from 88b9905 to 8a98f61 Compare June 12, 2026 07:21
@bhcopeland
bhcopeland merged commit d92504a into kernelci:master Jun 17, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants