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

Re: [PATCH 11/11] walker.c: use ref transaction for ref updates

From
Ronnie Sahlberg <sahlberg@google.com>
Date
Apr 21, 2014, 22:29 UTC
Message-ID
<CAL=YDW=A_L3J6bD+ZXMGoZ0piuQbdGmS1nmTpuCD0yZEnj2BOw@mail.gmail.com>
In-Reply-To
<5352D31A.6000107@alum.mit.edu>

I have updated the commit message with some text why I do not think this change is critical for this case. I will resend v2 of the patch series in a little while.

On Sat, Apr 19, 2014 at 12:48 PM, Michael Haggerty <mhagger@alum.mit.edu> wrote:
Show 24 quoted lines
> On 04/17/2014 09:46 PM, Ronnie Sahlberg wrote:
>> Switch to using ref transactions in walker_fetch(). As part of the refactoring
>> to use ref transactions we also fix a potential memory leak where in the
>> original code if write_ref_sha1() would fail we would end up returning from
>> the function without free()ing the msg string.
>
> I don't have time to review this last patch this evening, but one thing
> struck me.  It seems like the old code went to extra effort to lock all
> the write_ref references early in the function, whereas your modified
> version doesn't lock them until later.  Have you verified that you are
> not opening a possible race condition?  If so, your commit message
> should justify that it isn't a problem.  In other words, what does the
> code do between the old time of locking and the new time of locking and
> why doesn't it care whether the references are locked?
>
> Aside from my other comments, patches 01-10 in the series looked fine.
> Thanks!
>
> Michael
>
> --
> Michael Haggerty
> mhagger@alum.mit.edu
> http://softwareswirl.blogspot.com/
Previous: Junio C Hamano
Message 24 of 24 in “Use ref transactions from most callers”
  1. 00/11 Use ref transactions from most callersRonnie Sahlberg, Apr 17, 2014
  2. 01/11 refs.c: constify the sha arguments for ref_transaction_create|delete|updateRonnie Sahlberg, Apr 17, 2014
  3. Michael HaggertyApr 19, 2014
  4. 02/11 refs.c: change ref_transaction_update() to do error checking and return statusRonnie Sahlberg, Apr 17, 2014
  5. Michael HaggertyApr 19, 2014
  6. Jonathan NiederApr 25, 2014
  7. 03/11 refs.c: change ref_transaction_create to do error checking and return statusRonnie Sahlberg, Apr 17, 2014
  8. Michael HaggertyApr 19, 2014
  9. 04/11 refs.c: ref_transaction_delete to check for error and return statusRonnie Sahlberg, Apr 17, 2014
  10. Michael HaggertyApr 19, 2014
  11. 05/11 tag.c: use ref transactions when doing updatesRonnie Sahlberg, Apr 17, 2014
  12. Michael HaggertyApr 19, 2014
  13. 06/11 replace.c: use the ref transaction functions for updatesRonnie Sahlberg, Apr 17, 2014
  14. Michael HaggertyApr 19, 2014
  15. 07/11 commit.c: use ref transactions for updatesRonnie Sahlberg, Apr 17, 2014
  16. Michael HaggertyApr 19, 2014
  17. Ronnie SahlbergApr 21, 2014
  18. 08/11 sequencer.c: use ref transactions for all ref updatesRonnie Sahlberg, Apr 17, 2014
  19. 09/11 fast-import.c: change update_branch to use ref transactionsRonnie Sahlberg, Apr 17, 2014
  20. 10/11 branch.c: use ref transaction for all ref updatesRonnie Sahlberg, Apr 17, 2014
  21. 11/11 walker.c: use ref transaction for ref updatesRonnie Sahlberg, Apr 17, 2014
  22. Michael HaggertyApr 19, 2014
  23. Junio C HamanoApr 21, 2014
  24. Ronnie SahlbergApr 21, 2014

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.