-
-
Notifications
You must be signed in to change notification settings - Fork 480
Acquire write lock for pipeline creation into the database #5534
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
base: main
Are you sure you want to change the base?
Acquire write lock for pipeline creation into the database #5534
Conversation
|
@6543 I like this approach. Can you fix lint and tests? |
|
the DB error is an xorm issue ... let me look into it - I think it might lead to an upstream fix ;) |
| // we have an exclusive lock via createPipelineSQLiteLock already | ||
|
|
||
| case schemas.MYSQL: | ||
| if _, err := sess.Exec("LOCK TABLE `pipelines` WRITE"); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we cant do that or we dont have support for mariadb cluster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
What about the soft-lock approach #5477 (comment) from @lafriks |
|
thats how gitea does it and my next aproach ... |
|
Thanks for working on this task! |
closes #5477
fixes #3884
Make race condition save by let other
CreatePipelinewait till the currentCreatePipelineis done (either committed or errored)this happens via an table lock inside the database exept for sqlite