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

Re: [SCRIPT] cg-rpush & locking

From
Matthias Urlichs <smurf@smurf.noris.de>
Date
Jun 2, 2005, 07:14 UTC
Message-ID
<20050602071453.GA16616@kiste.smurf.noris.de>
In-Reply-To
<Pine.LNX.4.21.0506020223570.30848-100000@iabervon.org>
Hi,
Daniel Barkalow:
Show 8 quoted lines
> If the lock is only to protect against someone else modifying HEAD after
> we've checked that it is our starting point and before we modify it,
> there's no reason not to hold the lock while pushing; it wouldn't block
> anything other than someone doing a quick push in the middle of our long
> one, and thereby causing us to dump a lot of useless objects on the
> server (which will become obsolete as we will need to do the merge and
> push a different version).
> 

The objects we push aren't going to be obsolete. The server needs them anyway, because our HEAD refers to them.

What if the connection dies in the middle of a push? You then sit there waiting for it, and the lock, to time out. OTOH, an atomic cmpxchg on the server can't block and can't timeout.

Show 5 quoted lines
> you want to have the
> client watch for the resolution of the other transfer one way or the
> other, since you're in the current state precisely because you lost on
> getting the lock and now definitely need the next version.
> 

I disagree. Given that you need to wait for the upload to finish anyway (whether you know it or not ;-) it makes sense to spend the time actually uploading -- upload speed is frequently lower than download for individuals.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Who was that masked man?
Previous: Daniel BarkalowNext: Tony Lindgren
Message 7 of 13 in “[SCRIPT] cg-rpush & locking”
  1. Tony LindgrenMay 31, 2005
  2. Nicolas PitreMay 31, 2005
  3. Thomas GlanzmannJun 1, 2005
  4. Tony LindgrenJun 1, 2005
  5. Linus TorvaldsJun 2, 2005
  6. Daniel BarkalowJun 2, 2005
  7. Matthias UrlichsJun 2, 2005
  8. Tony LindgrenJun 2, 2005
  9. Matthias UrlichsJun 2, 2005
  10. Linus TorvaldsJun 2, 2005
  11. Tony LindgrenJun 2, 2005
  12. Daniel BarkalowJun 2, 2005
  13. Dan HolmsandJun 2, 2005

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.