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

backup: Fix shutdown hang when running in the background on linux #3152

Merged
merged 1 commit into from
Dec 6, 2020

Conversation

MichaelEischer
Copy link
Member

What does this PR change? What problem does it solve?

On Linux, during shutdown the backup commands waits for the terminal output goroutine to stop. However while running in the background that goroutine ignored the canceled context.

This PR lets the goroutine exit instead.

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

The hang was reported in the forum https://forum.restic.net/t/restic-alpine-container-cron-hangs-epoll-pwait/3334 .

Checklist

  • I have read the Contribution Guidelines
  • I have enabled maintainer edits for this PR
  • [ ] I have added tests for all changes in this PR Tested manually.
  • [ ] I have added documentation for the changes (in the manual)
  • 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

On shutdown the backup commands waits for the terminal output goroutine
to stop. However while running in the background the goroutine ignored
the canceled context.
@MichaelEischer MichaelEischer force-pushed the fix-backup-background-hang branch from 5b27d49 to 401ef92 Compare December 6, 2020 17:53
Copy link
Member

@fd0 fd0 left a comment

Choose a reason for hiding this comment

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

LGTM!

@fd0 fd0 merged commit b58799d into restic:master Dec 6, 2020
@MichaelEischer MichaelEischer deleted the fix-backup-background-hang branch December 13, 2020 18:57
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.

2 participants