]> source.dussan.org Git - gitea.git/commit
Only attempt to flush queue if the underlying worker pool is not finished (#18593...
authorzeripath <art27@cantab.net>
Sun, 6 Feb 2022 06:55:44 +0000 (06:55 +0000)
committerGitHub <noreply@github.com>
Sun, 6 Feb 2022 06:55:44 +0000 (14:55 +0800)
commit36c66303dff79ae6b6e9a2023901d23b2ce9683a
tree6e6b00bf97ae847796594888717eab7a80815661
parentf65e29c077f3df3822d7b7f874ba719fc08d267e
Only attempt to flush queue if the underlying worker pool is not finished (#18593) (#18620)

* Only attempt to flush queue if the underlying worker pool is not finished (#18593)

Backport #18593

There is a possible race whereby a worker pool could be cancelled but yet the
underlying queue is not empty. This will lead to flush-all cycling because it
cannot empty the pool.

* On shutdown of Persistant Channel Queues close datachan and empty

Partial Backport #18415

Although we attempt to empty the datachan in queues - due to
races we are better off just closing the channel and forcibly emptying
it in shutdown.

Fix #18618

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Move zero workers warning to debug

Fix #18617

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update modules/queue/manager.go

Co-authored-by: Gusted <williamzijl7@hotmail.com>
* Update modules/queue/manager.go

Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
modules/queue/manager.go
modules/queue/queue_disk_channel.go
modules/queue/workerpool.go