The Wayback Machine - https://web.archive.org/web/20230315181724/https://github.com/go-gitea/gitea/pull/18732
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

Add doctor commands to interrogate levelDB queues #18732

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

zeripath
Copy link
Contributor

Whilst looking at #17204 it appears that the unique-queues can end up in a weird corrupt state - I'm not certain how this happens - however the most difficult thing has been that there was no way to detect this.

In this PR I propose two new doctor commands:

  1. uniquequeues-corrupt which will look for queues where the internal set length and the internal queue length differ.
  2. queues-listdb which will simply list all the entries in the db.

The PR also adds a lot of additional tracing logs.

The ConflictedFiles status should always be reset if there are no conflicts
this prevents conflicted files being left over.

Fix go-gitea#17204

Signed-off-by: Andrew Thornton <[email protected]>
Given the repeated issues here I've just added some plain trace logging
which should allow for easier tracing of when processes are created.

Signed-off-by: Andrew Thornton <[email protected]>
modules/process/manager.go Outdated Show resolved Hide resolved
modules/doctor/queue.go Outdated Show resolved Hide resolved
modules/doctor/queue.go Show resolved Hide resolved
modules/doctor/queue.go Outdated Show resolved Hide resolved
modules/doctor/queue.go Show resolved Hide resolved
modules/doctor/queue.go Show resolved Hide resolved
modules/doctor/queue.go Show resolved Hide resolved
@singuliere
Copy link
Contributor

It would be useful to verify the autofix logic actually works by adding a test that runs it twice and asserts it does not complain the second time around. Just a suggestion.

modules/doctor/queue.go Show resolved Hide resolved
@lunny
Copy link
Member

lunny commented Jun 4, 2022

Please resolve the conflicts.

Unfortunately we need to remove the trace logging from the process
manager.
@codecov-commenter
Copy link

codecov-commenter commented Jun 4, 2022

Codecov Report

Merging #18732 (99c2b4b) into main (33e556e) will decrease coverage by 0.05%.
The diff coverage is 37.50%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main   #18732      +/-   ##
==========================================
- Coverage   47.44%   47.39%   -0.05%     
==========================================
  Files        1140     1141       +1     
  Lines      150804   151164     +360     
==========================================
+ Hits        71549    71647      +98     
- Misses      70788    71036     +248     
- Partials     8467     8481      +14     
Impacted Files Coverage Δ
models/actions/run.go 1.73% <0.00%> (+0.02%) ⬆️
models/actions/run_list.go 0.00% <0.00%> (ø)
models/actions/status.go 22.85% <0.00%> (-1.39%) ⬇️
models/auth/oauth2.go 60.52% <ø> (ø)
models/auth/twofactor.go 19.73% <ø> (ø)
models/db/engine.go 44.80% <ø> (ø)
models/issues/label.go 55.95% <0.00%> (ø)
models/unittest/testdb.go 12.92% <0.00%> (ø)
modules/auth/password/hash/pbkdf2.go 69.69% <ø> (ø)
modules/avatar/hash.go 100.00% <ø> (ø)
... and 68 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@lunny lunny modified the milestones: 1.17.0, 1.18.0 Jun 16, 2022
6543
6543 approved these changes Jul 12, 2022
services/pull/patch.go Show resolved Hide resolved
modules/queue/setting.go Show resolved Hide resolved
@lunny lunny modified the milestones: 1.18.0, 1.19.0 Oct 17, 2022
tdesveaux pushed a commit to dontnod/fork-gitea that referenced this pull request Oct 18, 2022
tdesveaux pushed a commit to dontnod/fork-gitea that referenced this pull request Oct 18, 2022
tdesveaux pushed a commit to dontnod/fork-gitea that referenced this pull request Oct 18, 2022
tdesveaux pushed a commit to dontnod/fork-gitea that referenced this pull request Oct 18, 2022
tdesveaux pushed a commit to dontnod/fork-gitea that referenced this pull request Nov 4, 2022
tdesveaux pushed a commit to dontnod/fork-gitea that referenced this pull request Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

8 participants