feat: release v0.27 unified HTTP limits and safe request shutdown

This commit is contained in:
2026-09-29 23:24:19 +08:00
parent 859f1851b1
commit 3b00bb55d1
42 changed files with 1191 additions and 70 deletions

View File

@@ -41,7 +41,7 @@ func run(ctx context.Context, path string) (runErr error) {
if err != nil {
return err
}
// Unjoined background work may still log. The owning process exits on this
// Unjoined HTTP or background work may still log. The owning process exits on this
// error; do not close its borrowed logger before that work has finished.
defer func() {
if !errors.Is(runErr, lifecycle.ErrResourcesRetained) {
@@ -52,8 +52,8 @@ func run(ctx context.Context, path string) (runErr error) {
if err != nil {
return err
}
// RunContext drains HTTP requests before returning. This scope owns dependencies
// and closes them exactly once, before closing the borrowed logger.
// Finish propagates incomplete HTTP draining: stop background work but retain
// shared dependencies when any handler is still running. Otherwise close once.
defer func() { runErr = deps.Finish(runErr) }()
app, err := handler.NewApp(deps)
if err != nil {