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

replace sync module #19620

Closed
6543 opened this issue May 5, 2022 · 1 comment · Fixed by #31813
Closed

replace sync module #19620

6543 opened this issue May 5, 2022 · 1 comment · Fixed by #31813
Assignees
Labels
type/refactoring Existing code has been cleaned up. There should be no new functionality.

Comments

@6543
Copy link
Member

6543 commented May 5, 2022

replace "code.gitea.io/gitea/modules/sync" with a cluster aware one ( #13791)

ref https://github.com/go-gitea/gitea/pull/19520/files#r859289575

// TODO: use clustered lock (unique queue? or *abuse* cache)
var pullWorkingPool = sync.NewExclusivePool()

// repoWorkingPool represents a working pool to order the parallel changes to the same repository
// TODO: use clustered lock (unique queue? or *abuse* cache)
var repoWorkingPool = sync.NewExclusivePool()

// TODO: use clustered lock (unique queue? or *abuse* cache)
wikiWorkingPool = sync.NewExclusivePool()

@6543 6543 added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label May 5, 2022
@6543 6543 self-assigned this May 5, 2022
@lunny
Copy link
Member

lunny commented May 5, 2022

The first one could be replaced by a unique queue at the moment to prevent there are two tasks for one pull request.

The second one could be resolved by a database transaction with optimistic lock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
3 participants