Acquire write lock for pipeline creation into the database#5534
Draft
6543 wants to merge 3 commits intowoodpecker-ci:mainfrom
Draft
Acquire write lock for pipeline creation into the database#55346543 wants to merge 3 commits intowoodpecker-ci:mainfrom
6543 wants to merge 3 commits intowoodpecker-ci:mainfrom
Conversation
6543
commented
Sep 21, 2025
Member
|
@6543 I like this approach. Can you fix lint and tests? |
Member
Author
|
the DB error is an xorm issue ... let me look into it - I think it might lead to an upstream fix ;) |
6543
commented
Oct 2, 2025
| // we have an exclusive lock via createPipelineSQLiteLock already | ||
|
|
||
| case schemas.MYSQL: | ||
| if _, err := sess.Exec("LOCK TABLE `pipelines` WRITE"); err != nil { |
Member
Author
There was a problem hiding this comment.
we cant do that or we dont have support for mariadb cluster
Member
Author
There was a problem hiding this comment.
Member
|
What about the soft-lock approach #5477 (comment) from @lafriks |
Member
Author
|
thats how gitea does it and my next aproach ... |
Member
|
Thanks for working on this task! |
Contributor
3 tasks
Member
Author
|
merged self contained hotfix: #6067 (comment) till i get time to do this here propperly |
3d175de to
773480d
Compare
Member
Author
|
NOTE: a propper locking should use sql (beside sqlite3) as woodpecker-server at some point should be culser capapble |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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