git/list[1] front-page[2] threads[3] people[4] search[5] about
 

push race

From
ABAngelo Borsotti <angelo.borsotti@gmail.com>
Date
Oct 15, 2012, 09:14 UTC
Message-ID
<CAB9Jk9Be4gGaBXixWN7Xju7N6RGKH+FonhaTbZFJ6uYsJDk8dg@mail.gmail.com>
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
Next: Matthieu Moy
Message 1 of 20 in “push race”
  1. Angelo BorsottiOct 15, 2012
  2. Matthieu MoyOct 15, 2012
  3. Nguyen Thai Ngoc DuyOct 15, 2012
  4. Ævar Arnfjörð BjarmasonOct 15, 2012
  5. demerphqOct 15, 2012
  6. Marc BranchaudOct 15, 2012
  7. Angelo BorsottiOct 15, 2012
  8. Jeff KingOct 15, 2012
  9. Jeff KingOct 15, 2012
  10. Shawn PearceOct 16, 2012
  11. Jeff KingOct 16, 2012
  12. Nguyen Thai Ngoc DuyOct 16, 2012
  13. Jeff KingOct 16, 2012
  14. Nguyen Thai Ngoc DuyOct 16, 2012
  15. Jeff KingOct 16, 2012
  16. Junio C HamanoOct 16, 2012
  17. Jeff KingOct 16, 2012
  18. Junio C HamanoOct 16, 2012
  19. Angelo BorsottiOct 16, 2012
  20. Angelo BorsottiOct 15, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.