Skip to content

Commit

Permalink
Workaround for pull requests stuck in conflict checking state
Browse files Browse the repository at this point in the history
See comment and upstream issue go-gitea#23050 for details
  • Loading branch information
brechtvl committed Feb 22, 2023
1 parent 6801d50 commit 2093ca5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions modules/queue/unique_queue_disk_channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,21 @@ func (q *PersistableChannelUniqueQueue) Has(data Data) (bool, error) {
if err != nil || has {
return has, err
}

// BLENDER: workaround for problem where on ungraceful shutdown, the persistent
// queue on disk contains PRs to be checked for conflicts. On restart these will
// be laoded into q.internal, but seemingly not start any work.
//
// At the same time InitializePullRequests will also add any PRs waiting for
// conflict checking to q.channelQueue, which does start work but does not write
// out its status because this Has() check returns true.
//
// Workaround is to just not check the persistent queue since it seems unnecessary
// for this particular case.
if q.Name() == "pr_patch_checker" {
return false, nil
}

q.lock.Lock()
defer q.lock.Unlock()
if q.internal == nil {
Expand Down

0 comments on commit 2093ca5

Please sign in to comment.