当多个客户端推送到同一个远程存储库时,git如何处理并发问题? [英] When multiple clients push to same remote repository, how does git deal with concurrency issues?

查看:107
本文介绍了当多个客户端推送到同一个远程存储库时,git如何处理并发问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于每个http请求,在服务器端运行单独的进程 git-http-backend



当多个客户端推送到相同的远程存储库时,它如何处理并发问题?



例如,它是否创建锁定文件和名称是什么? >

注意:远程仓库是裸的。

解决方案

通过SSH调用 - 请参阅 refs.c中的update_ref函数。锁定机制的实际实现位于 lock_file函数在lockfile.c ,是的,它创建一个 .lock 文件。下面,通过 open() O_EXCL 选项来完成。


For each http request, a separate process git-http-backend runs on the server side.

When multiple clients push to same remote repository, what does it do to handle concurrency issues?

For example, does it create lock file and what the name is?

Note: Remote repository is bare.

解决方案

In the same manner as if invoked via SSH -- see the update_ref function in refs.c. The actual implementation of the locking mechanism lives in the lock_file function in lockfile.c, and yes, it creates a .lock file in there. Under the hood, it's done via the O_EXCL option to open().

这篇关于当多个客户端推送到同一个远程存储库时,git如何处理并发问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆