Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR are not checked #14311

Closed
4 tasks
camlafit opened this issue Jan 12, 2021 · 2 comments · Fixed by #14651
Closed
4 tasks

PR are not checked #14311

camlafit opened this issue Jan 12, 2021 · 2 comments · Fixed by #14651
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail type/bug

Comments

@camlafit
Copy link
Contributor

  • Gitea version (or commit ref): 1.13.1
  • Git version: 2.20.1
  • Operating system: Debian 9.12
  • Database (use [x]):
    • PostgreSQL
    • [ x ] MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • [ x ] No
  • Log gist:
panic: interface conversion: interface is nil, not queue.UniqueQueue
goroutine 21890642 [running]:
code.gitea.io/gitea/modules/queue.(*PersistableChannelUniqueQueue).Has(0xc0041fac40, 0x232c9c0, 0xc00945e760, 0x2, 0xc00f51ca90, 0xc00835dc30)
        /var/git/go/src/code.gitea.io/gitea/modules/queue/unique_queue_disk_channel.go:152 +0x9d
code.gitea.io/gitea/services/pull.checkAndUpdateStatus(0xc000d52300)
        /var/git/go/src/code.gitea.io/gitea/services/pull/check.go:59 +0x97
code.gitea.io/gitea/services/pull.handle(0xc0103c5e20, 0x1, 0x1)
        /var/git/go/src/code.gitea.io/gitea/services/pull/check.go:227 +0x486
code.gitea.io/gitea/modules/queue.NewChannelUniqueQueue.func1(0xc001063040, 0x14, 0x14)
        /var/git/go/src/code.gitea.io/gitea/modules/queue/unique_queue_channel.go:59 +0x13d
code.gitea.io/gitea/modules/queue.(*WorkerPool).doWork(0xc003c6b180, 0x467d840, 0xc00f0fc780)
        /var/git/go/src/code.gitea.io/gitea/modules/queue/workerpool.go:344 +0x344
code.gitea.io/gitea/modules/queue.(*WorkerPool).addWorkers.func1(0xc003c6b180, 0x467d840, 0xc00f0fc780)
        /var/git/go/src/code.gitea.io/gitea/modules/queue/workerpool.go:238 +0x43
created by code.gitea.io/gitea/modules/queue.(*WorkerPool).addWorkers
        /var/git/go/src/code.gitea.io/gitea/modules/queue/workerpool.go:237 +0x56
panic: interface conversion: interface is nil, not queue.UniqueQueue

goroutine 20300 [running]:
code.gitea.io/gitea/modules/queue.(*PersistableChannelUniqueQueue).Has(0xc004e89110, 0x232c9c0, 0xc00bc42a90, 0x2, 0xc0050fc340, 0xc0051b3c30)
        /var/git/go/src/code.gitea.io/gitea/modules/queue/unique_queue_disk_channel.go:152 +0x9d
code.gitea.io/gitea/services/pull.checkAndUpdateStatus(0xc004fc0d00)
        /var/git/go/src/code.gitea.io/gitea/services/pull/check.go:59 +0x97
code.gitea.io/gitea/services/pull.handle(0xc015f1e890, 0x1, 0x1)
        /var/git/go/src/code.gitea.io/gitea/services/pull/check.go:227 +0x486
code.gitea.io/gitea/modules/queue.NewChannelUniqueQueue.func1(0xc00e0e4280, 0x14, 0x14)
        /var/git/go/src/code.gitea.io/gitea/modules/queue/unique_queue_channel.go:59 +0x13d
code.gitea.io/gitea/modules/queue.(*WorkerPool).doWork(0xc0005bed00, 0x467d7c0, 0xc007d3fe80)
        /var/git/go/src/code.gitea.io/gitea/modules/queue/workerpool.go:344 +0x344
code.gitea.io/gitea/modules/queue.(*WorkerPool).addWorkers.func1(0xc0005bed00, 0x467d7c0, 0xc007d3fe80)
        /var/git/go/src/code.gitea.io/gitea/modules/queue/workerpool.go:238 +0x43
created by code.gitea.io/gitea/modules/queue.(*WorkerPool).addWorkers
        /var/git/go/src/code.gitea.io/gitea/modules/queue/workerpool.go:237 +0x56

Description

All PR are blocked in stale state.
When we force pr_patch_checker with on process. We get previous error. A restart is needed
First log when we set 1 process to 5minutes, second when unlimited time.

@noerw noerw added type/bug issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail labels Jan 17, 2021
@zeripath
Copy link
Contributor

So I think this error is because of a slow start of your persistent queue for prs. There is very likely a problem with the persistent level db queue that backs up pr checking.

The reason you're seeing this is because of a race in the Has() function for the queue. I will put up a PR to fix that race and mark it as fixing this issue - however, that will merely displace the problem to the real problem you're seeing - which is very likely that you've corrupted your persistent queues.

If I had to make a bet as to the reason why that happens - its because you're kill -9ing gitea which you should not do.

zeripath added a commit to zeripath/gitea that referenced this issue Feb 11, 2021
There is potentially a race with a slow starting internal
queue causing a NPE if Has is checked before the internal
queue has been setup.

This PR adds a lock on the Has() fn.

Fix go-gitea#14311

Signed-off-by: Andrew Thornton <art27@cantab.net>
@camlafit
Copy link
Contributor Author

Hello

Since last discussion and evolve with binary, I don't use anymore kill -9 action. And I've tried to clean queue directory and was not working.
Last day problem doesn't look occured anymore, but I don't know why.

6543 pushed a commit that referenced this issue Feb 13, 2021
There is potentially a race with a slow starting internal
queue causing a NPE if Has is checked before the internal
queue has been setup.

This PR adds a lock on the Has() fn.

Fix #14311

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit to zeripath/gitea that referenced this issue Feb 13, 2021
Backport go-gitea#14651

There is potentially a race with a slow starting internal
queue causing a NPE if Has is checked before the internal
queue has been setup.

This PR adds a lock on the Has() fn.

Fix go-gitea#14311

Signed-off-by: Andrew Thornton <art27@cantab.net>
6543 added a commit that referenced this issue Feb 14, 2021
Backport #14651

There is potentially a race with a slow starting internal
queue causing a NPE if Has is checked before the internal
queue has been setup.

This PR adds a lock on the Has() fn.

Fix #14311

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: 6543 <6543@obermui.de>
@go-gitea go-gitea locked and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants