aboutsummaryrefslogtreecommitdiffstats
path: root/modules/graceful/manager_unix.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-05-22 09:38:38 +0800
committerGitHub <noreply@github.com>2023-05-22 09:38:38 +0800
commitec2a01d1e20c0d33c1ea7e362a7dfd5b653dd15f (patch)
tree8e19355b61950108a5b4a850429a19b2141d8386 /modules/graceful/manager_unix.go
parent2d3ebe889e7c25152821d4456b651e00fad43da1 (diff)
downloadgitea-ec2a01d1e20c0d33c1ea7e362a7dfd5b653dd15f.tar.gz
gitea-ec2a01d1e20c0d33c1ea7e362a7dfd5b653dd15f.zip
Fix regression: access log template, gitea manager cli command (#24838)
Close #24836 ![image](https://github.com/go-gitea/gitea/assets/2114189/95b025d2-f25f-4246-a08a-fe44ecb787a9) ![image](https://github.com/go-gitea/gitea/assets/2114189/c3afe1fa-2a23-420d-a016-3b67dcd04cd5)
Diffstat (limited to 'modules/graceful/manager_unix.go')
-rw-r--r--modules/graceful/manager_unix.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/graceful/manager_unix.go b/modules/graceful/manager_unix.go
index d89f6fc725..f949abfd21 100644
--- a/modules/graceful/manager_unix.go
+++ b/modules/graceful/manager_unix.go
@@ -244,6 +244,10 @@ func (g *Manager) DoGracefulRestart() {
log.Error("Error whilst forking from PID: %d : %v", os.Getpid(), err)
}
}
+ // doFork calls RestartProcess which starts a new Gitea process, so this parent process needs to exit
+ // Otherwise some resources (eg: leveldb lock) will be held by this parent process and the new process will fail to start
+ log.Info("PID: %d. Shutting down after forking ...", os.Getpid())
+ g.doShutdown()
} else {
log.Info("PID: %d. Not set restartable. Shutting down...", os.Getpid())
g.notify(stoppingMsg)