[PR #1835] [MERGED] Fix status table race condition #16075

Closed
opened 2025-11-02 12:01:44 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/1835
Author: @ethantkoenig
Created: 5/30/2017
Status: Merged
Merged: 5/31/2017
Merged by: @lunny

Base: masterHead: fix/race_cond


📝 Commits (1)

  • 7e77c75 Fix status table race condition

📊 Changes

5 files changed (+26 additions, -10 deletions)

View changed files

📝 models/repo.go (+3 -6)
📝 models/repo_mirror.go (+1 -2)
📝 models/user.go (+1 -2)
📝 modules/sync/status_pool.go (+12 -0)
📝 modules/sync/status_pool_test.go (+9 -0)

📄 Description

Fix race condition in usages of StatusTable. Previously, we would check if a name was running (one operation), and if not start that name (another operation); now they are performed in a single atomic operation.

Also see https://github.com/go-gitea/gitea/issues/1398#issuecomment-291721775


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/1835 **Author:** [@ethantkoenig](https://github.com/ethantkoenig) **Created:** 5/30/2017 **Status:** ✅ Merged **Merged:** 5/31/2017 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `fix/race_cond` --- ### 📝 Commits (1) - [`7e77c75`](https://github.com/go-gitea/gitea/commit/7e77c75be0f6c818ab8f820b4ee6623405196e06) Fix status table race condition ### 📊 Changes **5 files changed** (+26 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `models/repo.go` (+3 -6) 📝 `models/repo_mirror.go` (+1 -2) 📝 `models/user.go` (+1 -2) 📝 `modules/sync/status_pool.go` (+12 -0) 📝 `modules/sync/status_pool_test.go` (+9 -0) </details> ### 📄 Description Fix race condition in usages of `StatusTable`. Previously, we would check if a name was running (one operation), and if not start that name (another operation); now they are performed in a single atomic operation. Also see https://github.com/go-gitea/gitea/issues/1398#issuecomment-291721775 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:01:44 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#16075