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

[syncer] Only invoke cancel when successful #234

Merged
merged 1 commit into from
Nov 10, 2020

Conversation

patrick-ogrady
Copy link
Contributor

@patrick-ogrady patrick-ogrady commented Nov 10, 2020

In #228, we introduced a regression into syncer where a non-nil error could be silenced by context.Canceled. This PR fixes this regression.

In short, we were always calling context.Cancel() when syncer.Sync returned (with defer). Because of the extra locking on exit added in #228, this delayed the return of Sync but not the invocation of cancel. This caused other functions to return with a non-nil error before syncer.Sync (which had the useful error) and rosetta-cli to return context.Canceled as the error instead of something interesting (as the expected behavior of errgroup is to return the first non-nil error from Wait).

@patrick-ogrady patrick-ogrady merged commit d86a156 into master Nov 10, 2020
@patrick-ogrady patrick-ogrady deleted the patrick/fix-syncer-cancel branch November 10, 2020 04:34
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

2 participants