Skip to content
GitLab
项目 群组 主题 代码片段
  • /
  • 帮助
    • 帮助
    • 支持
    • 社区论坛
    • 提交反馈
  • 登录
  • L large
  • 项目信息
    • 项目信息
    • 动态
    • 标记
    • 成员
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者统计
    • 分支图
    • 比较修订版本
  • 议题 21
    • 议题 21
    • 列表
    • 看板
    • 服务台
    • 里程碑
  • 合并请求 12
    • 合并请求 12
  • CI/CD
    • CI/CD
    • 流水线
    • 作业
    • 产物
    • 计划
  • 部署
    • 部署
    • 环境
    • 发布
  • 软件包与镜像库
    • 软件包与镜像库
    • 软件包库
    • 容器镜像库
    • Terraform 模块
    • 模型实验
  • 监控
    • 监控
    • 事件
  • 分析
    • 分析
    • 价值流
    • CI/CD
    • 仓库
  • Wiki
    • Wiki
  • 代码片段
    • 代码片段
  • 动态
  • 分支图
  • 创建新议题
  • 作业
  • 提交
  • 议题看板
收起侧边栏
  • 王权利
  • large
  • 议题
  • #1544

Merge Request: Possible to have source branched removed *BEFORE* merge occurs

Created by: sroth80021

On GitLab 2.8, we recently saw an especially nasty bug, which seems to be a race condition in GitLab.

In short, a user went to process a merge request, and selected the 'remove source branch' checkbox. Then they clicked Accept Merge Request.

Unfortunately, the branch was removed JUST BEFORE the merge was attempted.

In other words, their branch was never merged into the master branch, and was also removed from the server. Fortunately, I was able to reconstruct the branch from some client-side state, but given how nasty this was, I wanted to enter an issue.

This is the ordering we see in the GitLab production.log and the Gitolite logs, indicating this sequence of events:

FROM GITLAB: MERGE REQUEST ACCEPTED

Started GET "/foo_main_bar/merge_requests/42/automerge?utf8=%E2%9C%93&should_remove_source_branch=1&commit=Accept+Merge+Request" for 127.0.0.1 at 2012-09-13 02:56:06 -0700 Processing by MergeRequestsController#automerge as JS Parameters: {"utf8"=>"✓", "should_remove_source_branch"=>"1", "commit"=>"Accept Merge Request", "project_id"=>"foo_main_bar", "id"=>"42"} Rendered merge_requests/automerge.js.haml (0.2ms) Completed 200 OK in 1961ms (Views: 2.0ms | ActiveRecord: 20.3ms)

FROM GITOLITE: DELETE BRANCH

2012-09-13.09:56:07 2080 pre_git foo_main_bar gitlab W any -> refs/.* 2012-09-13.09:56:07 2080 system,git,shell,-c,git-receive-pack '/scratch/git/repositories/foo_main_bar.git' 2012-09-13.09:56:07 2080 update,foo_main_bar,gitlab,+,refs/heads/reorder,4254d567f05f64f147aa1278843509f2e3f70947,0000000000000000000000000000000000000000 2012-09-13.09:56:07 2080 -> refs/.* 2012-09-13.09:56:07 2080 update foo_main_bar gitlab + refs/heads/reorder 4254d567f05f64f147aa1278843509f2e3f70947 0000000000000000000000000000000000000000 2012-09-13.09:56:07 2080 END

FROM GITOLITE: PUSH TO MASTER BRANCH

2012-09-13.09:56:08 2135 ssh ARGV=gitlab SOC=git-receive-pack 'foo_main_bar.git' FROM=10.234.12.34 2012-09-13.09:56:08 2135 access(foo_main_bar, gitlab, W, 'any'),-> refs/.* 2012-09-13.09:56:08 2135 trigger,Writable,access_1,ACCESS_1,foo_main_bar,gitlab,W,any,refs/.* 2012-09-13.09:56:08 2135 pre_git foo_main_bar gitlab W any -> refs/.* 2012-09-13.09:56:08 2135 system,git,shell,-c,git-receive-pack '/scratch/git/repositories/foo_main_bar.git' 2012-09-13.09:56:08 2135 update,foo_main_bar,gitlab,W,refs/heads/master,bcdacbf00660f7df0611ba19f21a3ed5308a9b57,455abee1e6a18c47aa95a35a2d72dd8f4d179a72 2012-09-13.09:56:08 2135 die VREF/update: helper program exit status 256 2012-09-13.09:56:08 2135 END

指派人
分配到
工时统计