Skip to content

Stop the apache and fpm images right away during a long startup step - #429

Merged
mistraloz merged 1 commit into
thecodingmachine:v5from
mistraloz:fix/stop-during-long-startup
Nov 5, 2026
Merged

mistraloz merged 1 commit into
thecodingmachine:v5from
mistraloz:fix/stop-during-long-startup

Conversation

@mistraloz

Copy link
Copy Markdown
Collaborator

Summary

A docker stop of an apache or fpm image during a long startup step (e.g. a STARTUP_COMMAND_*, or the
configuration of the extensions on a loaded host) waited for the end of the step: the container was killed after the
stop timeout (exit code 137 after 10 s).

  • Bug
  • Feature
  • Breaking changes

The entrypoint traps the stop signals of these images (SIGWINCH, SIGQUIT), and bash only runs a trap once the
foreground command ends. The startup steps now run in the background, and the entrypoint waits for them: wait is
interrupted by the signal. The cli images were not affected.

Test plan (required)

  • New test test_stopDuringStartupCommand (tool-startup-command.sh): it fails on the current apache and fpm
    images (10 s), and passes with the fix.
  • The whole test suite passes on PHP 8.4; the startup, daemon and variant tests pass on PHP 8.5 and 8.2.
  • With a loaded host simulated with --cpus=0.1, a stop during the startup now takes 0.1 to 0.4 s with the exit
    code 0, instead of 10 s with 137.

Checklist

  • I followed the guidelines in CONTRIBUTING guide
  • I have squashed any insignificant commits
  • This change has comments for package types, values, functions, and non-obvious lines of code

The stop signals of these images (SIGWINCH, SIGQUIT) are trapped by the entrypoint, and bash only runs a trap once
the foreground command ends: a docker stop during a STARTUP_COMMAND, or during the configuration of the extensions
on a loaded host, waited for the end of the step and the container was killed after the stop timeout. The startup
steps now run in the background, and the entrypoint waits for them.
@mistraloz
mistraloz merged commit 49648b9 into thecodingmachine:v5 Nov 5, 2026
25 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.

1 participant