]> source.dussan.org Git - gitea.git/commit
Multiple Queue improvements: LevelDB Wait on empty, shutdown empty shadow level queue...
authorzeripath <art27@cantab.net>
Sat, 15 May 2021 14:22:26 +0000 (15:22 +0100)
committerGitHub <noreply@github.com>
Sat, 15 May 2021 14:22:26 +0000 (16:22 +0200)
commitba526ceffe33a54b6015cdfbdc9bba920484dc23
treeddd9ff13b0da7b272b5a60445a997319cb0de882
parent9f19c2b8cca9edf2ad7b8803e6ed72b1aea322a5
Multiple Queue improvements: LevelDB Wait on empty, shutdown empty shadow level queue, reduce goroutines etc (#15693)

* move shutdownfns, terminatefns and hammerfns out of separate goroutines

Coalesce the shutdownfns etc into a list of functions that get run at shutdown
rather then have them run at goroutines blocked on selects.

This may help reduce the background select/poll load in certain
configurations.

* The LevelDB queues can actually wait on empty instead of polling

Slight refactor to cause leveldb queues to wait on empty instead of polling.

* Shutdown the shadow level queue once it is empty

* Remove bytefifo additional goroutine for readToChan as it can just be run in run

* Remove additional removeWorkers goroutine for workers

* Simplify the AtShutdown and AtTerminate functions and add Channel Flusher

* Add shutdown flusher to CUQ

* move persistable channel shutdown stuff to Shutdown Fn

* Ensure that UPCQ has the correct config

* handle shutdown during the flushing

* reduce risk of race between zeroBoost and addWorkers

* prevent double shutdown

Signed-off-by: Andrew Thornton <art27@cantab.net>
24 files changed:
modules/graceful/context.go
modules/graceful/manager.go
modules/graceful/manager_unix.go
modules/graceful/manager_windows.go
modules/indexer/code/indexer.go
modules/indexer/issues/indexer.go
modules/queue/bytefifo.go
modules/queue/manager.go
modules/queue/queue.go
modules/queue/queue_bytefifo.go
modules/queue/queue_channel.go
modules/queue/queue_channel_test.go
modules/queue/queue_disk.go
modules/queue/queue_disk_channel.go
modules/queue/queue_disk_channel_test.go
modules/queue/queue_disk_test.go
modules/queue/queue_redis.go
modules/queue/queue_wrapped.go
modules/queue/unique_queue_channel.go
modules/queue/unique_queue_disk.go
modules/queue/unique_queue_disk_channel.go
modules/queue/unique_queue_redis.go
modules/queue/workerpool.go
services/pull/check_test.go