]> source.dussan.org Git - gitea.git/commit
Avoid unexpected panic in graceful manager (#29629)
authorwxiaoguang <wxiaoguang@gmail.com>
Wed, 6 Mar 2024 11:50:39 +0000 (19:50 +0800)
committerGitHub <noreply@github.com>
Wed, 6 Mar 2024 11:50:39 +0000 (11:50 +0000)
commit90a3f2d4b7ed3890d9655c0334444f86d89b7b30
tree83d3d0b0c9a4728edf43f80a43d4309d1b9eb5f3
parentc381343a60b9c9eedb9dbc0931d1b87cb3c1f366
Avoid unexpected panic in graceful manager (#29629)

There is a fundamental design problem of the "manager" and the "wait
group".
If nothing has started, the "Wait" just panics: sync: WaitGroup is
reused before previous Wait has returned
There is no clear solution besides a complete rewriting of the "manager"

If there are some mistakes in the app.ini, end users would just see the
"panic", but not the real error messages. A real case: #27643

This PR is just a quick fix for the annoying panic problem.
modules/graceful/manager_unix.go
modules/graceful/manager_windows.go