git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* push race
@ 2012-10-15  9:14 Angelo Borsotti
  2012-10-15 11:05 ` Matthieu Moy
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Angelo Borsotti @ 2012-10-15  9:14 UTC (permalink / raw)
  To: git

Hello,

the push command checks first if the tips of the branches match those
of the remote
references, and if it does uploads the snapshot.
The checking and the uploading are two distinct operations that should
be indivisible.
Suppose that two workstations are pushing at the same time, and that the push of
the first has just checked the tips and found that they are ok, and
--before-- the
push command uploads the snapshot, the second workstation checks the tips too.
The test would be successful, and both workstation would upload their
files, actually
overwriting each others'.
I have browsed push.c, transport.c, connect.c, send-pack.c, but have
not found any
synchronization that protects the checking and the uploading with some critical
sections.
Has some sort of mutual exclusion been implemented, or it is up to the user to
guarantee that two pushes are not done simultaneously?

-Angelo Borsotti

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2012-10-16 19:10 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-15  9:14 push race Angelo Borsotti
2012-10-15 11:05 ` Matthieu Moy
2012-10-15 11:53   ` Nguyen Thai Ngoc Duy
     [not found] ` <CAPc5daUon3eLTDT=3wo_=rTCJWVe=ufCvmSzrjD=0T17Dxkpqw@mail.gmail.com>
2012-10-15 11:50   ` Angelo Borsotti
2012-10-15 14:09 ` Ævar Arnfjörð Bjarmason
2012-10-15 14:13   ` demerphq
2012-10-15 14:29   ` Marc Branchaud
2012-10-15 15:50     ` Angelo Borsotti
2012-10-15 18:58       ` Jeff King
2012-10-15 18:56     ` Jeff King
2012-10-16  2:09       ` Shawn Pearce
2012-10-16  4:51         ` Jeff King
2012-10-16  5:15           ` Nguyen Thai Ngoc Duy
2012-10-16  5:37             ` Jeff King
2012-10-16 10:45               ` Nguyen Thai Ngoc Duy
2012-10-16 17:02                 ` Jeff King
2012-10-16 17:21                 ` Junio C Hamano
2012-10-16 17:25                   ` Jeff King
2012-10-16 19:09                     ` Junio C Hamano
2012-10-16  6:35       ` Angelo Borsotti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).