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

scanner: Use context only for cancellation #1991

Merged
merged 2 commits into from
Sep 8, 2018
Merged

scanner: Use context only for cancellation #1991

merged 2 commits into from
Sep 8, 2018

Conversation

fd0
Copy link
Member

@fd0 fd0 commented Sep 8, 2018

What is the purpose of this change? What does it change?

When the scanner is slower than the actual backup, the tomb cancels the context passed to Scan(), which then returns ctx.Err(). In the end, the main function prints an error message that is not helpful ("Context cancelled") and exits with an error code although no error occurred.

The code now ignores the error in the context and just uses it for cancellation. The scanner is not supposed to return an error anyway.

Was the change discussed in an issue or in the forum before?

Closes #1978

Checklist

  • I have read the Contribution Guidelines
  • There's a new file in changelog/unreleased/ that describes the changes for our users (template here)
  • I have run gofmt on the code in all commits
  • All commit messages are formatted in the same style as the other commits in the repo
  • I'm done, this Pull Request is ready for review

When the scanner is slower than the actual backup, the tomb cancels the
context passed to Scan(), which then returns ctx.Err(). In the end, the
main function prints an error message that is not helpful ("Context
cancelled") and exits with an error code although no error occurred.

The code now ignores the error in the context and just uses it for
cancellation. The scanner is not supposed to return an error anyway.

Closes #1978
@fd0 fd0 merged commit e2d9900 into master Sep 8, 2018
fd0 added a commit that referenced this pull request Sep 8, 2018
scanner: Use context only for cancellation
@fd0 fd0 deleted the debug-1978 branch September 8, 2018 18:22
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.

1 participant