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_channel.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_channel.go')
-rw-r--r-- | modules/queue/queue_channel.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/queue/queue_channel.go b/modules/queue/queue_channel.go index 105388f421..5469c03100 100644 --- a/modules/queue/queue_channel.go +++ b/modules/queue/queue_channel.go @@ -117,7 +117,10 @@ func (q *ChannelQueue) FlushWithContext(ctx context.Context) error { select { case <-paused: return nil - case data := <-q.dataChan: + case data, ok := <-q.dataChan: + if !ok { + return nil + } if unhandled := q.handle(data); unhandled != nil { log.Error("Unhandled Data whilst flushing queue %d", q.qid) } |