Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ErrGroup Context Cancelation #90

Merged
merged 4 commits into from
Aug 7, 2020

Conversation

patrick-ogrady
Copy link
Contributor

@patrick-ogrady patrick-ogrady commented Aug 7, 2020

Related PR: coinbase/mesh-cli#88
Regression introduced in: #89

The context returned by errgroup.WithContext is canceled as soon as g.Wait returns. If this canceled context is passed to a handler or helper, it can have unintended consequences (some functions return immediately if the context is canceled).

Source: https://godoc.org/golang.org/x/sync/errgroup

Changes

  • Add test to ensure context passed to syncer handler/helper is not canceled
  • Use a separate context for ErrGroup

@coveralls
Copy link

Pull Request Test Coverage Report for Build 3315

  • 12 of 12 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.09%) to 69.92%

Totals Coverage Status
Change from base Build 3285: 0.09%
Covered Lines: 2178
Relevant Lines: 3115

💛 - Coveralls

@patrick-ogrady patrick-ogrady requested review from juliankoh, qiwu7, yfl92 and a team August 7, 2020 04:57
@patrick-ogrady patrick-ogrady merged commit 31075a5 into master Aug 7, 2020
@patrick-ogrady patrick-ogrady deleted the patrick/fix-context-cancel branch August 7, 2020 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants