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

Re: [PATCH 1/2] submodule--helper: initial clone learns retry logic

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 9, 2016, 19:59 UTC
Message-ID
<xmqqtwh2gmlv.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAGZ79kbpurbwAB4H5_JPMsaGHmbeZA=EWjMOfQGB6apLhEXVeA@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 7 quoted lines
> instead. But that is still unspecified, so we rather go with
>
> static int compare_ce(const void *one, const void *two, void *cb_data)
> {
>     const struct cache_entry *ce_one = one, *ce_two = two;
>     return strcmp(ce_one->name, ce_two->name);
> }

As I said below, I do not think it is worth addressing by making the code's behaviour on real systems worse. As long as what you have as the key into priority queue is a pointer to cache_entry, you cannot make it better from that point of view.

>> I think we have one or two other instances of such fishy pointer
>> comparison already in the codebase, so it is not a show-stopper, but
>> it would be better if this can be avoided and be replaced with
>> something that I do not have to raise eyebrows at ;-)

If you are using priority queue, it probably would make more sense to use the "priority" part properly---the paths whose ce happens to be lower in the address space are not inherently more important and deserve to be processed sooner. From "let's retry failed ones after finishing", I expected that the queue was either fifo (simplest), or a prio queue whose priority function would give lower priority for entries with least number of previous attempts (more involved but probably more fair).

So a proper "fix" probably is either (1) not to use prio queue as you are not doing anything with priority anyway, or (2) use something other than ce itself as entries in prio queue, so that the priority function can be computation that is more meaningful than "happens to sit in the lower part of the address space".

Previous: Stefan BellerNext: Junio C Hamano
Message 5 of 8 in “Dealing with a lot of submodules”
  1. 0/2 Dealing with a lot of submodulesStefan Beller, Jun 9, 2016
  2. 1/2 submodule--helper: initial clone learns retry logicStefan Beller, Jun 9, 2016
  3. Junio C HamanoJun 9, 2016
  4. Stefan BellerJun 9, 2016
  5. Junio C HamanoJun 9, 2016
  6. Junio C HamanoJun 9, 2016
  7. Stefan BellerJun 9, 2016
  8. 2/2 submodule update: continue when a clone failsStefan Beller, Jun 9, 2016

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.