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

Re: [RFC PATCH 1/1] maintenance: separate parallelism safe and unsafe tasks

From
Patrick Steinhardt <ps@pks.im>
Date
Nov 12, 2024, 06:28 UTC
Message-ID
<ZzL1jy3plVeld_3m@pks.im>
In-Reply-To
<CAFySSZCzxfqpMWH5ORv8fYb7f5WU3Fc2N99fW33wD9JOcYVrVA@mail.gmail.com>
On Mon, Nov 11, 2024 at 10:06:10AM -0800, Calvin Wan wrote:
Show 39 quoted lines
> On Sun, Nov 10, 2024 at 11:07 PM Patrick Steinhardt <ps@pks.im> wrote:
> > >       [TASK_LOOSE_OBJECTS] = {
> > >               "loose-objects",
> > >               maintenance_task_loose_objects,
> > >               loose_object_auto_condition,
> > > +             SAFE,
> > >       },
> > >       [TASK_INCREMENTAL_REPACK] = {
> > >               "incremental-repack",
> > >               maintenance_task_incremental_repack,
> > >               incremental_repack_auto_condition,
> > > +             SAFE,
> > > +     },
> > > +     [TASK_UNSAFE_GC] = {
> > > +             "unsafe-gc",
> > > +             maintenance_task_unsafe_gc,
> > > +             need_to_gc,
> > > +             UNSAFE,
> > > +             0,
> > > +     },
> > > +     [TASK_SAFE_GC] = {
> > > +             "safe-gc",
> > > +             maintenance_task_safe_gc,
> > > +             need_to_gc,
> > > +             SAFE,
> > > +             0,
> > >       },
> >
> > Hm. I wonder whether we really want to expose additional tasks to
> > address the issue, which feels like we're leaking implementation details
> > to our users. Would it maybe be preferable to instead introduce a new
> > optional callback function for every task that handles the pre-detach
> > logic?
> 
> This does sound like a good idea. However, would there be any issue
> with running all pre-detach logic before running post-detach logic?
> I'm thinking if pre-detach logic from a different function could
> affect post-detach logic from another. If not, I do agree this would
> be the best solution going forward.

Sure, in theory these can interact with each other. But is that any different when you represent this with tasks instead? The conflict would still exist there. It's also not any different to how things work right now: the "gc" task will impact the "repack" task, so configuring them both at the same time does not really make much sense.

Patrick
Previous: Calvin WanNext: Calvin Wan
Message 5 of 13 in “maintenance: separate parallelism safe and unsafe tasks”
  1. 0/1 maintenance: separate parallelism safe and unsafe tasksCalvin Wan, Nov 8, 2024
  2. 1/1 maintenance: separate parallelism safe and unsafe tasksCalvin Wan, Nov 8, 2024
  3. Patrick SteinhardtNov 11, 2024
  4. Calvin WanNov 11, 2024
  5. Patrick SteinhardtNov 12, 2024
  6. Calvin WanNov 15, 2024
  7. Junio C HamanoNov 18, 2024
  8. Patrick SteinhardtNov 18, 2024
  9. Junio C HamanoNov 11, 2024
  10. Junio C HamanoNov 11, 2024
  11. Calvin WanNov 11, 2024
  12. Junio C HamanoNov 11, 2024
  13. Calvin WanNov 11, 2024

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.