fix(dev): give serve the full shutdown grace before killing it

- dev.ShutdownGrace (internal, 15 seconds, longer than serve's 10-second
  drain) is the grace child.stop waits after SIGTERM, instead of 2 seconds
- summer's delegates use the same constant (appShutdownGrace)
- scaffolding docs say summer dev waits for serve's shutdown report (WR-03)
This commit is contained in:
Jakub Zych
2026-10-22 02:20:47 +02:00
parent 9c89705747
commit fc7706dfff
4 changed files with 56 additions and 6 deletions

View File

@@ -11,9 +11,9 @@ import (
"path/filepath"
"strings"
"syscall"
"time"
"git.golem15.com/golem15/summercms/internal/build"
"git.golem15.com/golem15/summercms/internal/dev"
"git.golem15.com/golem15/summercms/modules/bonfire"
)
@@ -181,9 +181,9 @@ func runAppCmd(cmd *exec.Cmd, argv []string) error {
}
// appShutdownGrace is how long a cancelled app binary may take to exit after
// SIGTERM before it is killed. It is longer than the 10-second shutdown
// timeout of serve and the workers, so they finish a graceful shutdown.
const appShutdownGrace = 15 * time.Second
// SIGTERM before it is killed: the grace summer dev gives serve as well,
// longer than the 10-second shutdown timeout of serve and the workers.
const appShutdownGrace = dev.ShutdownGrace
// newAppCmd builds the command that runs the app binary bin with argv in
// dir, writing to stdout and stderr (see appStreams). The child inherits