Skip to content

fix: persist container FinishedTime even when exit code DB write fails#28112

Draft
kairosci wants to merge 2 commits intocontainers:mainfrom
kairosci:fix/container-finished-time-292-years
Draft

fix: persist container FinishedTime even when exit code DB write fails#28112
kairosci wants to merge 2 commits intocontainers:mainfrom
kairosci:fix/container-finished-time-292-years

Conversation

@kairosci
Copy link
Copy Markdown

@kairosci kairosci commented Feb 18, 2026

Checklist

Ensure you have completed the following checklist for your pull request to be reviewed:

  • Certify you wrote the patch or otherwise have the right to pass it on as an open-source patch by signing all commits. (git commit -s). (If needed, use git commit -s --amend). The author email must match the sign-off email address. See CONTRIBUTING.md for more information.
  • Referenced issues using Fixes: #27282 in commit message (if applicable)
  • Tests have been added/updated (or no tests are needed)
  • Documentation has been updated (or no documentation changes are needed)
  • All commits pass make validatepr (format/lint checks)
  • Release note entered in the section below (or None if no user-facing changes)

Does this PR introduce a user-facing change?

Fix containers incorrectly showing "292 years ago" timestamp when container exit occurs during disk space exhaustion. Container exit times now persist correctly even when the exit code database write fails.

Fixes: #27282

@kairosci kairosci marked this pull request as draft February 18, 2026 14:03
@packit-as-a-service
Copy link
Copy Markdown

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

1 similar comment
@packit-as-a-service
Copy link
Copy Markdown

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

@kairosci kairosci force-pushed the fix/container-finished-time-292-years branch 3 times, most recently from d629f01 to 05ab487 Compare February 18, 2026 14:16
kairosci added a commit to kairosci/podman that referenced this pull request Feb 18, 2026
@kairosci kairosci force-pushed the fix/container-finished-time-292-years branch from 05ab487 to 9fb14b5 Compare February 18, 2026 14:17
kairosci added a commit to kairosci/podman that referenced this pull request Feb 18, 2026
Fixes: containers#28112
Signed-off-by: Alessio Attilio <attilio.alessio@protonmail.com>
@kairosci kairosci force-pushed the fix/container-finished-time-292-years branch 2 times, most recently from cbd7a7c to 26ba37f Compare February 18, 2026 14:24
@kairosci kairosci marked this pull request as ready for review February 18, 2026 14:26
When a container exits, handleExitFile() sets FinishedTime in the container
state but was only attempting to save via AddContainerExitCode(). If that
operation failed (e.g., DB error), the state including FinishedTime would
never be persisted.

This caused the container to show incorrect finish times like '292 years ago'
instead of the actual exit time.

The fix saves the complete container state to the database first, which
includes FinishedTime. The exit code table is supplementary; if it fails,
we log a warning but don't fail the entire operation since the main state
is already persisted.

Fixes: containers#27282
Signed-off-by: Alessio Attilio <attilio.alessio@protonmail.com>
@kairosci kairosci force-pushed the fix/container-finished-time-292-years branch from 26ba37f to 6f3e317 Compare February 18, 2026 14:35
@mheon
Copy link
Copy Markdown
Member

mheon commented Feb 18, 2026

This won't fix the reported reproducer in #27282 - we cannot write to the database at all when the disk is full. I don't think that's the only issue with writing exit codes, but I don't see another reproducer in that issue, and I'm not sure if this will help.

@Honny1
Copy link
Copy Markdown
Member

Honny1 commented Feb 19, 2026

I think instead of trying to write something somewhere, I would indicate to the user that the exit state is unknown.

@github-actions
Copy link
Copy Markdown

A friendly reminder that this PR had no activity for 30 days.

@kairosci kairosci marked this pull request as draft March 22, 2026 17:15
@github-actions github-actions bot removed the stale-pr label Mar 23, 2026
Signed-off-by: Alessio Attilio <attilio.alessio@protonmail.com>
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.

Status date is "292 years ago"

3 participants