-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Race condition upon queue flushing for an update #20320
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
Comments
Sarcasm is not helpful. If flushing queues could be done without Gitea running it would be done that way. It cannot and you should be able to work out why. I wrote a PR that would allow one to interrogate the level db queues #18732 but it has not gained traction. The logs report if the queues are empty on shutdown. You only need to have empty queues if you're doing a major upgrade - but even then it's not absolutely necessary most of the time. |
I'm sorry, I did not mean to cause offense. The occasional bit of humour helps me when writing technical texts and I, personally, appreciate it also when reading other's texts but I obviously overstepped what is considered sensible here and will accordingly stop doing this.
I actually can not work out why. Though since you tell me it is impossible, I'll gladly take your word for it.
That definitely seems like a good doctor command to have and I see it has seen more activity again since you mentioned it.
That is good to hear, but I do have two follow-up questions:
As long as the release notes only state “This PR will make old queue entrys unredable for the new version, make sure to flush the mirror sync queue before updating.” without comforting words that I'll easily notice and recover-from not having flushed the queues, I'll definitely sleep easier if I knew instead of hoped the queues to be empty. |
The queue code has been completely rewritten. Usually you do not need to do "flush-queues", it's not a well-designed behavior. |
Description
tl;dr
When upgrading to a different version, either there is no way without race conditions to flush the queues (and such a way needs to be created) or there is such a way (and it needs to be documented).
Expected Behaviour
When performing an upgrade that requires flushed queues (e.g. from 1.16.3 to 1.16.4), I can flush the queues without worrying they might be unflushed.
Actual Behaviour
The only documented way to flush queues I could find screams race condition so loudly that people started commenting “RIP headphone users” on unrelated YouTube-Videos.
Steps to Reproduce
This is, of course, only an example, but it was my scenario:
gitea manager flush-queues
in the documentationgitea manager flush-queues && systemctl stop gitea
)Conclusion
So, if there was (for some reason or another) no race condition going on or I could have somehow prevented race conditions from occurring, I would have loved to know about that. As it stands, my best guess is that there was a race condition, there was nothing I could do about it and I got lucky and it caused me no problems. But as queue flushing is presumably here to stay as an occasional upgrade requirement, I'm definitely not satisfied with this state of affairs.
Gitea Version
e.g. 1.16.3 → 1.16.4
How are you running Gitea?
By reading documentation and release notes. :P
Less tongue-in-cheek, from binary via systemd, but this feels relevant to all variants of running Gitea.
The text was updated successfully, but these errors were encountered: