Skip to content

Wait for running jobs on shutdown, and take OS security fixes in image builds - #41

Merged
kalfasyan merged 2 commits into
mainfrom
claude/project-thread-n6v9kl
Nov 18, 2026
Merged

kalfasyan merged 2 commits into
mainfrom
claude/project-thread-n6v9kl

Conversation

@kalfasyan

Copy link
Copy Markdown
Collaborator

Requested by Yannis · project thread

Background jobs writing after shutdown

backend/jobs tests crashed now and then: the catch-up run that MustAdd starts on serve runs in the background and saves its result when it ends, and the test had already cleaned up the app by then. go test -race -count=40 -run TestMustAdd ./jobs/ crashed locally before this change and passes after it.

Each job now tracks its runs (the catch-up run and cron runs), and OnTerminate waits for them before the app closes; runs that would start after that are skipped. In production this means a stopping server lets a running job finish and record itself. New test: TestShutdownWaitsForARunningJob.

Security workflow's image scan

The released image still has zlib 1.3.2-r1 (CVE-2026-4738, critical), so Grype fails. Like plasto and the other apps, the app image now runs apk upgrade and the worker image apt-get upgrade in the runtime stage, and publishing builds that stage without the cache (no-cache-filters: runtime). The scan goes green once the next release is published after merge.

Checks

make check, make test and go test -race -count=3 ./jobs/ pass locally.


Generated by Claude Code

A catch-up run started when the server starts runs in the background and
records its result when it ends. When the app stopped first, as tests do as
soon as they finish, that write hit a closed app and crashed the test run now
and then. Each job now tracks its runs, and the app waits for them on
terminate; runs that would start after that are skipped.
The released image still has zlib 1.3.2-r1 (CVE-2026-4738), so the Security
workflow's image scan fails. Upgrade the runtime stage's packages and build that
stage without the cache when publishing, as plasto and the other apps do. The
scan passes once the next release is published.
@kalfasyan kalfasyan self-assigned this Nov 18, 2026
@kalfasyan
kalfasyan merged commit 6d6055c into main Nov 18, 2026
13 checks passed
@kalfasyan
kalfasyan deleted the claude/project-thread-n6v9kl branch November 18, 2026 09:57
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