[PR #1813] [MERGED] Fix deadlock in updateRepository #16061

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

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/1813
Author: @ethantkoenig
Created: 5/25/2017
Status: Merged
Merged: 5/26/2017
Merged by: @lunny

Base: masterHead: fix_update_repo


📝 Commits (1)

  • d654c39 Fix deadlock in updateRepository

📊 Changes

1 file changed (+8 additions, -4 deletions)

View changed files

📝 models/repo.go (+8 -4)

📄 Description

Fix a potential deadlock in updateRepository(). The call to UpdateSize() previously did not use the provided session (i.e. the e parameter), and the resulting query could become blocked by the ongoing session/transaction, since both the query and the ongoing transaction need to access the repository table.

I experienced this deadlock locally, using PostgreSQL.


🔄 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/1813 **Author:** [@ethantkoenig](https://github.com/ethantkoenig) **Created:** 5/25/2017 **Status:** ✅ Merged **Merged:** 5/26/2017 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `fix_update_repo` --- ### 📝 Commits (1) - [`d654c39`](https://github.com/go-gitea/gitea/commit/d654c392b5c862d8df9570f23d50831c901a681c) Fix deadlock in updateRepository ### 📊 Changes **1 file changed** (+8 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `models/repo.go` (+8 -4) </details> ### 📄 Description Fix a potential deadlock in `updateRepository()`. The call to `UpdateSize()` previously did not use the provided session (i.e. the `e` parameter), and the resulting query could become blocked by the ongoing session/transaction, since both the query and the ongoing transaction need to access the `repository` table. I experienced this deadlock locally, using PostgreSQL. --- <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:25 -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#16061