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

Re: [PATCH] Add fetch.recurseSubmoduleParallelism config option

From
Stefan Beller <sbeller@google.com>
Date
Oct 13, 2015, 16:03 UTC
Message-ID
<CAGZ79kYZ+RyjvkgY8+aeRpnVtaCyqFxQqQ3wggjtef7y6MNLcA@mail.gmail.com>
In-Reply-To
<xmqqzizn9qaf.fsf@gitster.mtv.corp.google.com>
On Tue, Oct 13, 2015 at 12:32 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>>> The parallel_process API could learn a new "verbose" feature that it
>>> by itself shows some messages like
>>>
>>>     "processing the 'frotz' job with N tasks"
>>>     "M tasks finished (N still running)"
>>
>> I know what to fill in for M and N, 'frotz' is a bit unclear to me.
>
> At least I don't know what M and N should be, and I'm curious how
> you'll define them.  See below.

I presumed the second school of thought. Another alternative there would be to have 3 numbers:

    "M tasks finished (N still running, K pending output)"
Show 27 quoted lines
>
>>> in the output stream from strategic places.  For example, the first
>>> message will come at the end of pp_init(), and the second message
>>> will be appended at the end of buffered output of a task that has
>>> just been finished.  Once you have something like that, you could
>>> check for them in a test in t/.
>>>
>>> Just a thought.
>>
>> I like that thought. :)
>
>
> A few more random thoughts:
>
>  * The only thing you could rely on if you were to use the above in
>    your tests is the one from pp_init() that declares how many
>    processes the machinery is going to use.  M/N will be unstable,
>    depending on the scheduling order (e.g. the foreground process
>    may take a lot of time to finish, while many other processes
>    finish first).
>
>  * Every time the foreground process (i.e. the one whose output is
>    tee-ed to the overall output from the machinery) finishes, you
>    can emit "M tasks finished (N still running)", but I am not sure
>    what M should be.  It is debatable how to account for background
>    processes that have already completed but whose output haven't
>    been shown.

Assuming we go with your second school of thought (N are the real running processes, M including the finished but still pending output tasks), we may have confusing output, as the output order may confuse the reader:

    N=8 M=13 (output from live task)
    ...
    N=8 M=12 (output from buffered task)
    ...

Anyone who has no knowledge of the internals, wonders why M goes *down* ?

Show 20 quoted lines
>
>    One school of thought that is in line with the "pretend as if the
>    background tasks are started immediately after the foreground
>    task finishes, and they run at infinite speed and produce output
>    in no time" idea, on which the "queue output from the background
>    processes and emit at once in order to avoid intermixing" design
>    was based on, would be not to include them in M (i.e. finished
>    ones), because their output haven't been emitted and we are
>    pretending that they haven't even been started.  If you take this
>    approach, you however may have to include them in N (i.e. still
>    running), but that would likely bump N beyond the maximum number
>    of simultaneous processes.
>
>    The other school of thought would of course tell the truth and
>    include the number of finished background processes in M, as they
>    have finished already in the reality.  This will not risk showing
>    N that is beyond the maximum, but your first "progress" output
>    might say "3 tasks finished", which will make it look odd in a
>    different way.
>
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 9 in “Add fetch.recurseSubmoduleParallelism config option”
  1. Add fetch.recurseSubmoduleParallelism config optionStefan Beller, Oct 12, 2015
  2. Junio C HamanoOct 12, 2015
  3. Stefan BellerOct 12, 2015
  4. Junio C HamanoOct 12, 2015
  5. Stefan BellerOct 16, 2015
  6. Junio C HamanoOct 16, 2015
  7. Junio C HamanoOct 13, 2015
  8. Stefan BellerOct 13, 2015
  9. Junio C HamanoOct 13, 2015

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.