diff --git a/CHANGELOG.md b/CHANGELOG.md index eb8149fd..f85fe655 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 7.16.1 (unreleased) +### Implementation changes and bug fixes +- [PR #1252](https://github.com/rqlite/rqlite/pull/1252): Stop the HTTP server first on shutdown. + ## 7.16.0 (May 5th 2023) ### New features - [PR #1243](https://github.com/rqlite/rqlite/pull/1243): Support automatically restoring from AWS S3. Thanks to [VOXO](https://voxo.co/) for funding this development. diff --git a/cmd/rqlited/main.go b/cmd/rqlited/main.go index dedfb0f0..b9fa02bc 100644 --- a/cmd/rqlited/main.go +++ b/cmd/rqlited/main.go @@ -194,6 +194,10 @@ func main() { signal.Notify(terminate, syscall.SIGINT, syscall.SIGTERM, os.Interrupt) <-terminate + // Stop the HTTP server first, so clients get notification as soon as + // possible that the node is going away. + httpServ.Close() + if cfg.RaftStepdownOnShutdown { if str.IsLeader() { // Don't log a confusing message if not (probably) Leader @@ -204,7 +208,6 @@ func main() { } backupSrvCancel() - httpServ.Close() if err := str.Close(true); err != nil { log.Printf("failed to close store: %s", err.Error()) }