Skip to content

exporter: don't use errgroup.WithContext()#35

Open
omar-polo wants to merge 1 commit into
integration/fsfrom
op/fs-export-ctx
Open

exporter: don't use errgroup.WithContext()#35
omar-polo wants to merge 1 commit into
integration/fsfrom
op/fs-export-ctx

Conversation

@omar-polo

Copy link
Copy Markdown
Collaborator

the returned context is a child of the one we pass, except that it cancel itself when 1) a function ran with g.Go() returns an error or 2) when g.Wait() gets called.

Now, none of these two situations could happen, so remove one level of context chaining for semplification.

the returned context is a child of the one we pass, except that it
cancel itself when 1) a function ran with g.Go() returns an error
or 2) when g.Wait() gets called.

Now, none of these two situations could happen, so remove one level
of context chaining for semplification.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes unnecessary context chaining in the filesystem exporter by switching from errgroup.WithContext(ctx) to a plain errgroup.Group, since the derived context was not used for cancellation semantics in this implementation.

Changes:

  • Replace errgroup.WithContext(ctx) with var g errgroup.Group in FSExporter.Export.
  • Keep existing concurrency limiting via g.SetLimit(p.opts.MaxConcurrency).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mathieu-plak mathieu-plak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants