diff options
author | zeripath <art27@cantab.net> | 2022-01-29 11:37:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-29 11:37:08 +0000 |
commit | 92b715e0f2c655169e82fb76f7b109b8de21a095 (patch) | |
tree | 738844c8f60a3baade0dc23ed17db587343df3a4 /modules/queue/queue_bytefifo.go | |
parent | 726715fcfb73751452adbf5cf594908b3954b080 (diff) | |
download | gitea-92b715e0f2c655169e82fb76f7b109b8de21a095.tar.gz gitea-92b715e0f2c655169e82fb76f7b109b8de21a095.zip |
Attempt to prevent the deadlock in the QueueDiskChannel Test again (#18415)
* Attempt to prevent the deadlock in the QueueDiskChannel Test again
This time we're going to adjust the pause tests to only test the right
flag.
* Only switch off pushback once we know that we are not pushing anything else
* Ensure full redirection occurs
* More nicely handle a closed datachan
* And handle similar problems in queue_channel_test
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules/queue/queue_bytefifo.go')
-rw-r--r-- | modules/queue/queue_bytefifo.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/queue/queue_bytefifo.go b/modules/queue/queue_bytefifo.go index 7f2acf3deb..bf153d70bb 100644 --- a/modules/queue/queue_bytefifo.go +++ b/modules/queue/queue_bytefifo.go @@ -205,7 +205,10 @@ loop: // tell the pool to shutdown. q.baseCtxCancel() return - case data := <-q.dataChan: + case data, ok := <-q.dataChan: + if !ok { + return + } if err := q.PushBack(data); err != nil { log.Error("Unable to push back data into queue %s", q.name) } |